Package org.eclipse.jetty.client.util
Class BasicAuthentication.BasicResult
- java.lang.Object
-
- org.eclipse.jetty.client.util.BasicAuthentication.BasicResult
-
- All Implemented Interfaces:
Authentication.Result
- Enclosing class:
- BasicAuthentication
public static class BasicAuthentication.BasicResult extends java.lang.Object implements Authentication.Result
Basic authentication result.Application may utilize this class directly via
AuthenticationStore.addAuthenticationResult(Result)
to perform preemptive authentication, that is immediately sending the authorization header based on the fact that the URI is known to require authentication and that username and password are known a priori.
-
-
Constructor Summary
Constructors Constructor Description BasicResult(java.net.URI uri, java.lang.String user, java.lang.String password)
BasicResult(java.net.URI uri, HttpHeader header, java.lang.String user, java.lang.String password)
BasicResult(java.net.URI uri, HttpHeader header, java.lang.String user, java.lang.String password, java.nio.charset.Charset charset)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
apply(Request request)
Applies the authentication result to the given request.java.net.URI
getURI()
java.lang.String
toString()
-
-
-
Constructor Detail
-
BasicResult
public BasicResult(java.net.URI uri, java.lang.String user, java.lang.String password)
-
BasicResult
public BasicResult(java.net.URI uri, HttpHeader header, java.lang.String user, java.lang.String password)
-
BasicResult
public BasicResult(java.net.URI uri, HttpHeader header, java.lang.String user, java.lang.String password, java.nio.charset.Charset charset)
-
-
Method Detail
-
getURI
public java.net.URI getURI()
- Specified by:
getURI
in interfaceAuthentication.Result
- Returns:
- the URI of the request that has been used to generate this
Authentication.Result
-
apply
public void apply(Request request)
Description copied from interface:Authentication.Result
Applies the authentication result to the given request. Typically, aAuthorization
header is added to the request, with the right information to successfully authenticate at the server.- Specified by:
apply
in interfaceAuthentication.Result
- Parameters:
request
- the request to authenticate
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-