Package org.wildfly.security.http
Interface HttpServerAuthenticationMechanism
-
- All Known Implementing Classes:
BasicAuthenticationMechanism
,BearerTokenAuthenticationMechanism
,ClientCertAuthenticationMechanism
,DigestAuthenticationMechanism
,ExternalAuthenticationMechanism
,FormAuthenticationMechanism
,OidcAuthenticationMechanism
,PrivilegedServerMechanism
,SpnegoAuthenticationMechanism
,UsernamePasswordAuthenticationMechanism
public interface HttpServerAuthenticationMechanism
Definition 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 void
dispose()
Dispose of any resources currently held by this authentication mechanism.void
evaluateRequest(HttpServerRequest request)
Evaluate the current request and attempt to authenticate if appropriate.String
getMechanismName()
Get the name of this mechanism, where appropriate this should be the IANA registered name.default Object
getNegotiatedProperty(String propertyName)
Get the property negotiated as a result of authentication.default <T> T
getNegotiationProperty(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 anyHttpServerMechanismsResponder
as 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
null
if 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 returnnull
if 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
null
if 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.
-
-