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
AnHttpServerAuthenticationMechanismto support OpenID Connect (OIDC).- Author:
- Farah Juma
-
-
Field Summary
Fields Modifier and Type Field Description private CallbackHandlercallbackHandlerprivate OidcClientContextoidcClientContextprivate 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 RequestAuthenticatorcreateRequestAuthenticator(OidcHttpFacade httpFacade, OidcClientConfiguration deployment)voidevaluateRequest(HttpServerRequest request)Evaluate the current request and attempt to authenticate if appropriate.private intgetConfidentialPort()StringgetMechanismName()Get the name of this mechanism, where appropriate this should be the IANA registered name.private OidcClientContextgetOidcClientContext(HttpServerRequest request)private booleankeycloakPreActions(OidcHttpFacade httpFacade, OidcClientConfiguration oidcClientConfiguration)private booleanpreflightCors(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:HttpServerAuthenticationMechanismGet the name of this mechanism, where appropriate this should be the IANA registered name.- Specified by:
getMechanismNamein interfaceHttpServerAuthenticationMechanism- Returns:
- the name of the mechanism.
-
evaluateRequest
public void evaluateRequest(HttpServerRequest request) throws HttpAuthenticationException
Description copied from interface:HttpServerAuthenticationMechanismEvaluate 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 anyHttpServerMechanismsResponderas required.- Specified by:
evaluateRequestin 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)
-
-