Package org.wildfly.security.http
Interface HttpServerAuthenticationMechanism
-
- All Known Implementing Classes:
BasicAuthenticationMechanism,BearerTokenAuthenticationMechanism,ClientCertAuthenticationMechanism,DigestAuthenticationMechanism,ExternalAuthenticationMechanism,FormAuthenticationMechanism,OidcAuthenticationMechanism,PrivilegedServerMechanism,SpnegoAuthenticationMechanism,UsernamePasswordAuthenticationMechanism
public interface HttpServerAuthenticationMechanismDefinition of a server side HTTP authentication mechanism.- Author:
- Darran Lofthouse
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voiddispose()Dispose of any resources currently held by this authentication mechanism.voidevaluateRequest(HttpServerRequest request)Evaluate the current request and attempt to authenticate if appropriate.StringgetMechanismName()Get the name of this mechanism, where appropriate this should be the IANA registered name.default ObjectgetNegotiatedProperty(String propertyName)Get the property negotiated as a result of authentication.default <T> TgetNegotiationProperty(String propertyName, Class<T> type)Get the strongly typed property negotiated as a result of authentication.
-
-
-
Method Detail
-
getMechanismName
String getMechanismName()
Get the name of this mechanism, where appropriate this should be the IANA registered name.- Returns:
- the name of the mechanism.
-
evaluateRequest
void evaluateRequest(HttpServerRequest request) throws HttpAuthenticationException
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 anyHttpServerMechanismsResponderas required.- Parameters:
request- representation of the HTTP request.- Throws:
HttpAuthenticationException- if there is an internal failure handling the authentication.
-
getNegotiatedProperty
default Object getNegotiatedProperty(String propertyName)
Get the property negotiated as a result of authentication. Mechanisms only make properties available after indicating a successful authentication has completed.- Parameters:
propertyName- the name of the property.- Returns:
- the value of the property or
nullif the specified property is not available.
-
getNegotiationProperty
default <T> T getNegotiationProperty(String propertyName, Class<T> type)
Get the strongly typed property negotiated as a result of authentication. Mechanisms only make properties available after indicating a successful authentication has completed. Note: This form of the mechanism will also returnnullif the property is set but is of a different type.- Parameters:
propertyName- the name of the property.type- the expected type of the property.- Returns:
- the value of the property or
nullif the specified property is not available or is of a different type..
-
dispose
default void dispose()
Dispose of any resources currently held by this authentication mechanism.
-
-