Package org.eclipse.jetty.client.api
Interface Authentication
-
- All Known Implementing Classes:
AbstractAuthentication
,BasicAuthentication
,DigestAuthentication
,SPNEGOAuthentication
@Deprecated(since="2021-05-27") public interface Authentication
Deprecated.The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.Authentication
represents a mechanism to authenticate requests for protected resources.Authentication
s are added to anAuthenticationStore
, which is thenqueried
to find the rightAuthentication
mechanism to use based on its type, URI and realm, as returned byWWW-Authenticate
response headers.If an
Authentication
mechanism is found, it is thenexecuted
for the given request, returning anAuthentication.Result
, which is then stored in theAuthenticationStore
so that subsequent requests can be preemptively authenticated.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
Authentication.HeaderInfo
Deprecated.The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.static interface
Authentication.Result
Deprecated.The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ANY_REALM
Deprecated.Constant used to indicate that any realm will match.
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description Authentication.Result
authenticate(Request request, ContentResponse response, Authentication.HeaderInfo headerInfo, Attributes context)
Deprecated.Executes the authentication mechanism for the given request, returning aAuthentication.Result
that can be used to actually authenticate the request viaAuthentication.Result.apply(Request)
.boolean
matches(java.lang.String type, java.net.URI uri, java.lang.String realm)
Deprecated.MatchesAuthentication
s based on the given parameters
-
-
-
Method Detail
-
matches
boolean matches(java.lang.String type, java.net.URI uri, java.lang.String realm)
Deprecated.MatchesAuthentication
s based on the given parameters- Parameters:
type
- theAuthentication
type such as "Basic" or "Digest"uri
- the request URIrealm
- the authentication realm as provided in theWWW-Authenticate
response header- Returns:
- true if this authentication matches, false otherwise
-
authenticate
Authentication.Result authenticate(Request request, ContentResponse response, Authentication.HeaderInfo headerInfo, Attributes context)
Deprecated.Executes the authentication mechanism for the given request, returning aAuthentication.Result
that can be used to actually authenticate the request viaAuthentication.Result.apply(Request)
.If a request for
"/secure"
returns aAuthentication.Result
, then the result may be used for other requests such as"/secure/foo"
or"/secure/bar"
, unless those resources are protected by other realms.- Parameters:
request
- the request to execute the authentication mechanism forresponse
- the 401 response obtained in the previous attempt to request the protected resourceheaderInfo
- theWWW-Authenticate
(orProxy-Authenticate
) header chosen for this authentication (among the many that the response may contain)context
- the conversation context in case the authentication needs multiple exchanges to be completed and information needs to be stored across exchanges- Returns:
- the authentication result, or null if the authentication could not be performed
-
-