Class LoginAuthenticator
java.lang.Object
org.eclipse.jetty.security.authentication.LoginAuthenticator
- All Implemented Interfaces:
 Authenticator
- Direct Known Subclasses:
 BasicAuthenticator, DigestAuthenticator, EthereumAuthenticator, FormAuthenticator, JaspiAuthenticator, JaspiAuthenticator, MultiAuthenticator, OpenIdAuthenticator, SPNEGOAuthenticator, SslClientCertAuthenticator
- 
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classThis Authentication represents a just completed authentication, that has sent a response, typically to redirect the client to the original request target..static classBase class for representing a successful authentication state.Nested classes/interfaces inherited from interface Authenticator
Authenticator.Configuration, Authenticator.Factory, Authenticator.NoOp - 
Field Summary
FieldsFields inherited from interface Authenticator
BASIC_AUTH, CERT_AUTH, CERT_AUTH2, DIGEST_AUTH, FORM_AUTH, MULTI_AUTH, NEGOTIATE_AUTH, OPENID_AUTH, SIWE_AUTH, SPNEGO_AUTH - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionintbooleanIf the UserIdentity returned fromLoginService.login(String, Object, Request, Function)is not null, it is assumed that the user is fully authenticated and we need to change the session id to prevent session fixation vulnerability.voidvoidsetConfiguration(Authenticator.Configuration configuration) Configure the AuthenticatorvoidsetLoginService(LoginService loginService) voidsetProxyMode(boolean proxy) Sets the authenticator to operate in proxy authentication mode.protected voidupdateSession(Request httpRequest, Response httpResponse) Update the session on authentication.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Authenticator
getAuthenticationType, getConstraintAuthentication, prepareRequest, validateRequest 
- 
Field Details
- 
_loginService
 - 
_identityService
 
 - 
 - 
Constructor Details
- 
LoginAuthenticator
protected LoginAuthenticator() 
 - 
 - 
Method Details
- 
isProxyMode
public boolean isProxyMode()- Returns:
 - true if this authenticator is in proxy mode.
 - See Also:
 
 - 
setProxyMode
public void setProxyMode(boolean proxy) Sets the authenticator to operate in proxy authentication mode.When set to
true, this mode changes the behavior of the authentication helpers:getChallengeHeader()will returnProxy-Authenticate.getUnauthorizedStatusCode()will return407.getAuthorizationHeader()will return theProxy-Authorizationheader.
false, which uses the standardWWW-AuthenticateandAuthorizationheaders with a401status code.- Parameters:
 proxy-trueto enable proxy authentication mode.
 - 
getAuthorizationHeader
- Returns:
 - The authorization header to read credentials from, either
AuthorizationorProxy-Authorization, depending on the proxy mode. - See Also:
 
 - 
getChallengeHeader
- Returns:
 - The challenge header to send to the client, either
WWW-AuthenticateorProxy-Authenticate, depending on the proxy mode. - See Also:
 
 - 
getUnauthorizedStatusCode
public int getUnauthorizedStatusCode()- Returns:
 - The status code for an authentication challenge, either
401or407, depending on the proxy mode. - See Also:
 
 - 
login
If the UserIdentity returned fromLoginService.login(String, Object, Request, Function)is not null, it is assumed that the user is fully authenticated and we need to change the session id to prevent session fixation vulnerability. If the UserIdentity is not necessarily fully authenticated, then subclasses must override this method and determine when the UserIdentity IS fully authenticated and renew the session id.- Parameters:
 username- the username of the client to be authenticatedpassword- the user's credentialrequest- the inbound request that needs authentication
 - 
logout
 - 
setConfiguration
Description copied from interface:AuthenticatorConfigure the Authenticator- Specified by:
 setConfigurationin interfaceAuthenticator- Parameters:
 configuration- the configuration
 - 
getLoginService
 - 
setLoginService
 - 
updateSession
Update the session on authentication. The session is changed to a new instance with a new ID if and only if:- A session exists.
 - The 
Authenticator.Configuration.isSessionRenewedOnAuthentication()returns true. - The session ID has been given to unauthenticated responses
 
- Parameters:
 httpRequest- the requesthttpResponse- the response- See Also:
 
 
 -