Package org.wildfly.security.http.cert
Class ClientCertAuthenticationMechanism
- java.lang.Object
-
- org.wildfly.security.http.cert.ClientCertAuthenticationMechanism
-
- All Implemented Interfaces:
HttpServerAuthenticationMechanism
final class ClientCertAuthenticationMechanism extends Object implements HttpServerAuthenticationMechanism
The CLIENT_CERT authentication mechanism.- Author:
- Darran Lofthouse
-
-
Field Summary
Fields Modifier and Type Field Description private CallbackHandlercallbackHandlerprivate booleanskipVerification
-
Constructor Summary
Constructors Constructor Description ClientCertAuthenticationMechanism(CallbackHandler callbackHandler, boolean skipVerification)Construct a new instance of theClientCertAuthenticationMechanismmechanism.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private booleanattemptAuthentication(HttpServerRequest request, Function<SecurityDomain,IdentityCache> cacheFunction)private booleanattemptReAuthentication(HttpServerRequest request, Function<SecurityDomain,IdentityCache> cacheFunction)private Function<SecurityDomain,IdentityCache>createIdentityCacheFunction(HttpServerRequest request)voidevaluateRequest(HttpServerRequest request)Evaluate the current request and attempt to authenticate if appropriate.private voidfail(HttpServerRequest request)StringgetMechanismName()Get the name of this mechanism, where appropriate this should be the IANA registered name.private booleansucceed(HttpServerRequest request)-
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
-
skipVerification
private final boolean skipVerification
-
-
Constructor Detail
-
ClientCertAuthenticationMechanism
ClientCertAuthenticationMechanism(CallbackHandler callbackHandler, boolean skipVerification)
Construct a new instance of theClientCertAuthenticationMechanismmechanism.- Parameters:
callbackHandler- theCallbackHandlerto use to verify the supplied credentials and to notify to establish the current identity.skipVerification- whether the certificate verification usingEvidenceVerifyCallbackshould be skipped
-
-
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.
- See Also:
HttpServerAuthenticationMechanism.getMechanismName()
-
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.- See Also:
HttpServerAuthenticationMechanism.evaluateRequest(org.wildfly.security.http.HttpServerRequest)
-
attemptAuthentication
private boolean attemptAuthentication(HttpServerRequest request, Function<SecurityDomain,IdentityCache> cacheFunction) throws HttpAuthenticationException
- Throws:
HttpAuthenticationException
-
succeed
private boolean succeed(HttpServerRequest request) throws HttpAuthenticationException
- Throws:
HttpAuthenticationException
-
fail
private void fail(HttpServerRequest request) throws HttpAuthenticationException
- Throws:
HttpAuthenticationException
-
attemptReAuthentication
private boolean attemptReAuthentication(HttpServerRequest request, Function<SecurityDomain,IdentityCache> cacheFunction) throws HttpAuthenticationException
- Throws:
HttpAuthenticationException
-
createIdentityCacheFunction
private Function<SecurityDomain,IdentityCache> createIdentityCacheFunction(HttpServerRequest request)
-
-