Class OpenIdAuthenticator
- All Implemented Interfaces:
org.eclipse.jetty.security.Authenticator
Implements authentication using OpenId Connect on top of OAuth 2.0.
The OpenIdAuthenticator redirects unauthenticated requests to the OpenID Connect Provider. The End-User is
eventually redirected back with an Authorization Code to the path set by setRedirectPath(String) within the context.
The Authorization Code is then used to authenticate the user through the OpenIdCredentials and OpenIdLoginService.
Once a user is authenticated the OpenID Claims can be retrieved through an attribute on the session with the key CLAIMS.
The full response containing the OAuth 2.0 Access Token can be obtained with the session attribute RESPONSE.
SessionAuthentication is then used to wrap Authentication results so that they are associated with the session.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThis Authentication represents a just completed OpenId Connect authentication.Nested classes/interfaces inherited from interface org.eclipse.jetty.security.Authenticator
org.eclipse.jetty.security.Authenticator.AuthConfiguration, org.eclipse.jetty.security.Authenticator.Factory -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final StringDeprecated.static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class org.eclipse.jetty.security.authentication.LoginAuthenticator
_identityService, _loginService -
Constructor Summary
ConstructorsConstructorDescriptionOpenIdAuthenticator(OpenIdConfiguration configuration) OpenIdAuthenticator(OpenIdConfiguration configuration, String errorPage) OpenIdAuthenticator(OpenIdConfiguration configuration, String redirectPath, String errorPage) -
Method Summary
Modifier and TypeMethodDescriptionprotected StringgetChallengeUri(org.eclipse.jetty.server.Request request) booleanDeprecated.booleanisErrorPage(String pathInContext) booleanisJSecurityCheck(String uri) org.eclipse.jetty.server.UserIdentityvoidlogout(jakarta.servlet.ServletRequest request) voidprepareRequest(jakarta.servlet.ServletRequest request) booleansecureResponse(jakarta.servlet.ServletRequest req, jakarta.servlet.ServletResponse res, boolean mandatory, org.eclipse.jetty.server.Authentication.User validatedUser) voidsetAlwaysSaveUri(boolean alwaysSave) Deprecated.voidsetConfiguration(org.eclipse.jetty.security.Authenticator.AuthConfiguration authConfig) voidsetErrorPage(String path) voidsetRedirectPath(String redirectPath) org.eclipse.jetty.server.AuthenticationvalidateRequest(jakarta.servlet.ServletRequest req, jakarta.servlet.ServletResponse res, boolean mandatory) Methods inherited from class org.eclipse.jetty.security.authentication.LoginAuthenticator
getLoginService, renewSession
-
Field Details
-
CLAIMS
- See Also:
-
RESPONSE
- See Also:
-
ISSUER
- See Also:
-
REDIRECT_PATH
- See Also:
-
ERROR_PAGE
- See Also:
-
J_URI
- See Also:
-
J_POST
- See Also:
-
J_METHOD
- See Also:
-
J_SECURITY_CHECK
- See Also:
-
ERROR_PARAMETER
- See Also:
-
CSRF_TOKEN
Deprecated.- See Also:
-
-
Constructor Details
-
OpenIdAuthenticator
public OpenIdAuthenticator() -
OpenIdAuthenticator
-
OpenIdAuthenticator
-
OpenIdAuthenticator
public OpenIdAuthenticator(OpenIdConfiguration configuration, String redirectPath, String errorPage)
-
-
Method Details
-
setConfiguration
public void setConfiguration(org.eclipse.jetty.security.Authenticator.AuthConfiguration authConfig) - Specified by:
setConfigurationin interfaceorg.eclipse.jetty.security.Authenticator- Overrides:
setConfigurationin classorg.eclipse.jetty.security.authentication.LoginAuthenticator
-
getAuthMethod
-
setAlwaysSaveUri
Deprecated. -
isAlwaysSaveUri
Deprecated. -
setRedirectPath
-
setErrorPage
-
login
public org.eclipse.jetty.server.UserIdentity login(String username, Object credentials, jakarta.servlet.ServletRequest request) - Overrides:
loginin classorg.eclipse.jetty.security.authentication.LoginAuthenticator
-
logout
public void logout(jakarta.servlet.ServletRequest request) - Overrides:
logoutin classorg.eclipse.jetty.security.authentication.LoginAuthenticator
-
prepareRequest
public void prepareRequest(jakarta.servlet.ServletRequest request) - Specified by:
prepareRequestin interfaceorg.eclipse.jetty.security.Authenticator- Overrides:
prepareRequestin classorg.eclipse.jetty.security.authentication.LoginAuthenticator
-
validateRequest
public org.eclipse.jetty.server.Authentication validateRequest(jakarta.servlet.ServletRequest req, jakarta.servlet.ServletResponse res, boolean mandatory) throws org.eclipse.jetty.security.ServerAuthException - Throws:
org.eclipse.jetty.security.ServerAuthException
-
isJSecurityCheck
-
isErrorPage
-
getChallengeUri
-
secureResponse
public boolean secureResponse(jakarta.servlet.ServletRequest req, jakarta.servlet.ServletResponse res, boolean mandatory, org.eclipse.jetty.server.Authentication.User validatedUser)
-