Package org.wildfly.security.http.oidc
Class OidcAuthenticationMechanism
- java.lang.Object
-
- org.wildfly.security.http.oidc.OidcAuthenticationMechanism
-
- All Implemented Interfaces:
HttpServerAuthenticationMechanism
final class OidcAuthenticationMechanism extends Object implements HttpServerAuthenticationMechanism
AnHttpServerAuthenticationMechanism
to support OpenID Connect (OIDC).- Author:
- Farah Juma
-
-
Field Summary
Fields Modifier and Type Field Description private CallbackHandler
callbackHandler
private OidcClientContext
oidcClientContext
private Map<String,?>
properties
-
Constructor Summary
Constructors Constructor Description OidcAuthenticationMechanism(Map<String,?> properties, CallbackHandler callbackHandler, OidcClientContext oidcClientContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private RequestAuthenticator
createRequestAuthenticator(OidcHttpFacade httpFacade, OidcClientConfiguration deployment)
void
evaluateRequest(HttpServerRequest request)
Evaluate the current request and attempt to authenticate if appropriate.private int
getConfidentialPort()
String
getMechanismName()
Get the name of this mechanism, where appropriate this should be the IANA registered name.private OidcClientContext
getOidcClientContext(HttpServerRequest request)
private boolean
keycloakPreActions(OidcHttpFacade httpFacade, OidcClientConfiguration oidcClientConfiguration)
private boolean
preflightCors(OidcHttpFacade httpFacade, OidcClientConfiguration oidcClientConfiguration)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.wildfly.security.http.HttpServerAuthenticationMechanism
dispose, getNegotiatedProperty, getNegotiationProperty
-
-
-
-
Field Detail
-
callbackHandler
private final CallbackHandler callbackHandler
-
oidcClientContext
private final OidcClientContext oidcClientContext
-
-
Constructor Detail
-
OidcAuthenticationMechanism
OidcAuthenticationMechanism(Map<String,?> properties, CallbackHandler callbackHandler, OidcClientContext oidcClientContext)
-
-
Method Detail
-
getMechanismName
public String getMechanismName()
Description copied from interface:HttpServerAuthenticationMechanism
Get the name of this mechanism, where appropriate this should be the IANA registered name.- Specified by:
getMechanismName
in interfaceHttpServerAuthenticationMechanism
- Returns:
- the name of the mechanism.
-
evaluateRequest
public void evaluateRequest(HttpServerRequest request) throws HttpAuthenticationException
Description copied from interface:HttpServerAuthenticationMechanism
Evaluate the current request and attempt to authenticate if appropriate. The mechanism should call the appropriate callback methods on the {link HttpServerResponse} to both indicate the outcome of the evaluation and to register anyHttpServerMechanismsResponder
as required.- Specified by:
evaluateRequest
in interfaceHttpServerAuthenticationMechanism
- Parameters:
request
- representation of the HTTP request.- Throws:
HttpAuthenticationException
- if there is an internal failure handling the authentication.
-
createRequestAuthenticator
private RequestAuthenticator createRequestAuthenticator(OidcHttpFacade httpFacade, OidcClientConfiguration deployment)
-
getOidcClientContext
private OidcClientContext getOidcClientContext(HttpServerRequest request)
-
getConfidentialPort
private int getConfidentialPort()
-
keycloakPreActions
private boolean keycloakPreActions(OidcHttpFacade httpFacade, OidcClientConfiguration oidcClientConfiguration)
-
preflightCors
private boolean preflightCors(OidcHttpFacade httpFacade, OidcClientConfiguration oidcClientConfiguration)
-
-