Package org.wildfly.security.http.util
Class PrivilegedServerMechanism
- java.lang.Object
-
- org.wildfly.security.http.util.PrivilegedServerMechanism
-
- All Implemented Interfaces:
HttpServerAuthenticationMechanism
final class PrivilegedServerMechanism extends Object implements HttpServerAuthenticationMechanism
AHttpServerAuthenticationMechanism
with a storedAccessControlContext
that is used for all request processing calls.- Author:
- Darran Lofthouse
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
PrivilegedServerMechanism.HttpServerRequestWrapper
-
Field Summary
Fields Modifier and Type Field Description private AccessControlContext
accessControlContext
private HttpServerAuthenticationMechanism
mechanism
-
Constructor Summary
Constructors Constructor Description PrivilegedServerMechanism(HttpServerAuthenticationMechanism mechanism, AccessControlContext accessControlContext)
Construct a new instance ofPrivilegedServerMechanism
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.Object
getNegotiatedProperty(String propertyName)
Get the property negotiated as a result of authentication.<T> T
getNegotiationProperty(String propertyName, Class<T> type)
Get the strongly typed property negotiated as a result of authentication.private HttpServerMechanismsResponder
wrap(HttpServerMechanismsResponder toWrap)
-
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
-
-
-
-
Field Detail
-
mechanism
private final HttpServerAuthenticationMechanism mechanism
-
accessControlContext
private final AccessControlContext accessControlContext
-
-
Constructor Detail
-
PrivilegedServerMechanism
PrivilegedServerMechanism(HttpServerAuthenticationMechanism mechanism, AccessControlContext accessControlContext)
Construct a new instance ofPrivilegedServerMechanism
.- Parameters:
mechanism
- the mechanism to be wrapped.accessControlContext
- theAccessControlContext
to use for calls to the wrapped mechanism.
-
-
Method Detail
-
getMechanismName
public String getMechanismName()
Description copied from interface:HttpServerAuthenticationMechanism
Get the name of this mechanism, where appropriate this should be the IANA registered name.- Specified by:
getMechanismName
in interfaceHttpServerAuthenticationMechanism
- Returns:
- the name of the mechanism.
- See Also:
HttpServerAuthenticationMechanism.getMechanismName()
-
evaluateRequest
public void evaluateRequest(HttpServerRequest request) throws HttpAuthenticationException
Description copied from interface:HttpServerAuthenticationMechanism
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.- Specified by:
evaluateRequest
in 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)
-
getNegotiatedProperty
public Object getNegotiatedProperty(String propertyName)
Description copied from interface:HttpServerAuthenticationMechanism
Get the property negotiated as a result of authentication. Mechanisms only make properties available after indicating a successful authentication has completed.- Specified by:
getNegotiatedProperty
in interfaceHttpServerAuthenticationMechanism
- Parameters:
propertyName
- the name of the property.- Returns:
- the value of the property or
null
if the specified property is not available.
-
getNegotiationProperty
public <T> T getNegotiationProperty(String propertyName, Class<T> type)
Description copied from interface:HttpServerAuthenticationMechanism
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.- Specified by:
getNegotiationProperty
in interfaceHttpServerAuthenticationMechanism
- 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..
-
wrap
private HttpServerMechanismsResponder wrap(HttpServerMechanismsResponder toWrap)
-
-