AuthenticationHandlerpublic class JWTRedirectAuthenticationHandler extends MultiMechsAuthenticationHandler
JWTRedirectAuthenticationHandler extends
MultiMechsAuthenticationHandler to add WebSSO behavior for UIs. The expected
SSO token is a JsonWebToken (JWT). The supported algorithm is RS256 which
uses PKI between the token issuer and consumer. The flow requires a redirect
to a configured authentication server URL and a subsequent request with the
expected JWT token. This token is cryptographically verified and validated.
The user identity is then extracted from the token and used to create an
AuthenticationToken - as expected by the AuthenticationFilter.
The supported configuration properties are:
MultiMechsAuthenticationHandler.AuthHandlerEnum| Modifier and Type | Field | Description |
|---|---|---|
static java.lang.String |
AUTHENTICATION_PROVIDER_URL |
|
static java.lang.String |
JWT_CLIENT_ID |
|
static java.lang.String |
JWT_CLIENT_SECRET |
MTYPEWWW_AUTHENTICATE| Constructor | Description |
|---|---|
JWTRedirectAuthenticationHandler() |
| Modifier and Type | Method | Description |
|---|---|---|
void |
addHeader(javax.servlet.http.HttpServletResponse response) |
Children must override this method with supplying corresponding header
|
java.lang.String |
getAuthUrl() |
|
java.lang.String |
getJWTTokenFromCode(java.lang.String code,
javax.servlet.http.HttpServletRequest request) |
|
java.lang.String |
getTokenUrl() |
|
void |
init(java.util.Properties config) |
Initializes the authentication handler instance.
|
AuthenticationToken |
postauthenticate(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
Children must override this method to perform real authentication based on the information received
in the request header
|
authenticate, destroy, getAuthBasedEntity, getAuthorizationHeaderName, getType, managementOperationpublic static final java.lang.String AUTHENTICATION_PROVIDER_URL
public static final java.lang.String JWT_CLIENT_ID
public static final java.lang.String JWT_CLIENT_SECRET
public void init(java.util.Properties config)
throws javax.servlet.ServletException
This method is invoked by the AuthenticationFilter.init(javax.servlet.FilterConfig) method.
init in interface AuthenticationHandlerinit in class MultiMechsAuthenticationHandlerconfig - configuration properties to initialize the handler.javax.servlet.ServletException - thrown if the handler could not be initialized.public AuthenticationToken postauthenticate(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.io.IOException, AuthenticationException
MultiMechsAuthenticationHandlerpostauthenticate in class MultiMechsAuthenticationHandlerjava.io.IOExceptionAuthenticationExceptionpublic java.lang.String getJWTTokenFromCode(java.lang.String code,
javax.servlet.http.HttpServletRequest request)
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String getTokenUrl()
public java.lang.String getAuthUrl()
public void addHeader(javax.servlet.http.HttpServletResponse response)
MultiMechsAuthenticationHandleraddHeader in class MultiMechsAuthenticationHandlerCopyright © 2008–2025 Apache Software Foundation. All rights reserved.