Package org.wildfly.security.http
Interface HttpServerAuthenticationMechanism
- All Known Implementing Classes:
ExternalAuthenticationMechanism,SpnegoAuthenticationMechanism,UsernamePasswordAuthenticationMechanism
public interface HttpServerAuthenticationMechanism
Definition of a server side HTTP authentication mechanism.
- Author:
- Darran Lofthouse
-
Method Summary
Modifier and TypeMethodDescriptiondefault voiddispose()Dispose of any resources currently held by this authentication mechanism.voidevaluateRequest(HttpServerRequest request) Evaluate the current request and attempt to authenticate if appropriate.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 Details
-
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
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
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
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.
-