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
AHttpServerAuthenticationMechanismwith a storedAccessControlContextthat is used for all request processing calls.- Author:
- Darran Lofthouse
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classPrivilegedServerMechanism.HttpServerRequestWrapper
-
Field Summary
Fields Modifier and Type Field Description private AccessControlContextaccessControlContextprivate HttpServerAuthenticationMechanismmechanism
-
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 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.ObjectgetNegotiatedProperty(String propertyName)Get the property negotiated as a result of authentication.<T> TgetNegotiationProperty(String propertyName, Class<T> type)Get the strongly typed property negotiated as a result of authentication.private HttpServerMechanismsResponderwrap(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- theAccessControlContextto use for calls to the wrapped mechanism.
-
-
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)
-
getNegotiatedProperty
public Object getNegotiatedProperty(String propertyName)
Description copied from interface:HttpServerAuthenticationMechanismGet the property negotiated as a result of authentication. Mechanisms only make properties available after indicating a successful authentication has completed.- Specified by:
getNegotiatedPropertyin interfaceHttpServerAuthenticationMechanism- Parameters:
propertyName- the name of the property.- Returns:
- the value of the property or
nullif the specified property is not available.
-
getNegotiationProperty
public <T> T getNegotiationProperty(String propertyName, Class<T> type)
Description copied from interface:HttpServerAuthenticationMechanismGet 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.- Specified by:
getNegotiationPropertyin interfaceHttpServerAuthenticationMechanism- 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..
-
wrap
private HttpServerMechanismsResponder wrap(HttpServerMechanismsResponder toWrap)
-
-