Class LoginAuthenticator
java.lang.Object
org.eclipse.jetty.ee8.security.authentication.LoginAuthenticator
- All Implemented Interfaces:
- Authenticator
- Direct Known Subclasses:
- BasicAuthenticator, ConfigurableSpnegoAuthenticator, DigestAuthenticator, FormAuthenticator, JaspiAuthenticator, OpenIdAuthenticator, SslClientCertAuthenticator
- 
Nested Class SummaryNested classes/interfaces inherited from interface AuthenticatorAuthenticator.AuthConfiguration, Authenticator.Factory
- 
Field SummaryFieldsFields inherited from interface AuthenticatorBASIC_AUTH, CERT_AUTH, CERT_AUTH2, DIGEST_AUTH, FORM_AUTH, NEGOTIATE_AUTH, OPENID_AUTH, SPNEGO_AUTH
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionIf the UserIdentity returned fromLoginService.login(String, Object, org.eclipse.jetty.server.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.voidlogout(javax.servlet.ServletRequest request) voidprepareRequest(javax.servlet.ServletRequest request) Called prior to validateRequest.protected javax.servlet.http.HttpSessionrenewSession(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Change the session id.voidsetConfiguration(Authenticator.AuthConfiguration configuration) Configure the AuthenticatorMethods inherited from class Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface AuthenticatorgetAuthMethod, secureResponse, validateRequest
- 
Field Details- 
_loginService
- 
_identityService
 
- 
- 
Constructor Details- 
LoginAuthenticatorprotected LoginAuthenticator()
 
- 
- 
Method Details- 
prepareRequestpublic void prepareRequest(javax.servlet.ServletRequest request) Description copied from interface:AuthenticatorCalled prior to validateRequest. The authenticator can manipulate the request to update it with information that can be inspected prior to validateRequest being called. The primary purpose of this method is to satisfy the Servlet Spec 3.1 section 13.6.3 on handling Form authentication where the http method of the original request causing authentication is not the same as the http method resulting from the redirect after authentication.- Specified by:
- prepareRequestin interface- Authenticator
- Parameters:
- request- the request to manipulate
 
- 
loginpublic UserIdentity login(String username, Object password, javax.servlet.ServletRequest servletRequest) If the UserIdentity returned fromLoginService.login(String, Object, org.eclipse.jetty.server.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 authenticated
- password- the user's credential
- servletRequest- the inbound request that needs authentication
 
- 
logoutpublic void logout(javax.servlet.ServletRequest request) 
- 
setConfigurationDescription copied from interface:AuthenticatorConfigure the Authenticator- Specified by:
- setConfigurationin interface- Authenticator
- Parameters:
- configuration- the configuration
 
- 
getLoginService
- 
renewSessionprotected javax.servlet.http.HttpSession renewSession(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Change the session id. The session is changed to a new instance with a new ID if and only if:- A session exists.
- The Authenticator.AuthConfiguration.isSessionRenewedOnAuthentication()returns true.
- The session ID has been given to unauthenticated responses
 - Parameters:
- request- the request
- response- the response
- Returns:
- The new session.
 
 
-