Package org.wildfly.security.http.basic
Class BasicAuthenticationMechanism
- java.lang.Object
- 
- org.wildfly.security.mechanism.http.UsernamePasswordAuthenticationMechanism
- 
- org.wildfly.security.http.basic.BasicAuthenticationMechanism
 
 
- 
- All Implemented Interfaces:
- HttpServerAuthenticationMechanism
 
 final class BasicAuthenticationMechanism extends UsernamePasswordAuthenticationMechanism Implementation of the HTTP BASIC authentication mechanism- Author:
- Darran Lofthouse
 
- 
- 
Field SummaryFields Modifier and Type Field Description private static StringCHALLENGE_PREFIXprivate StringconfiguredRealmprivate booleanincludeCharsetprivate static intPREFIX_LENGTHprivate booleansilentIf silent is true then this mechanism will only take effect if there is an Authorization header.(package private) static StringSILENT- 
Fields inherited from class org.wildfly.security.mechanism.http.UsernamePasswordAuthenticationMechanismcallbackHandler
 
- 
 - 
Constructor SummaryConstructors Constructor Description BasicAuthenticationMechanism(CallbackHandler callbackHandler, String configuredRealm, boolean silent, boolean includeCharset)Construct a new instance ofBasicAuthenticationMechanism.
 - 
Method SummaryAll 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.private voidprepareResponse(HttpServerRequest request, String realmName, HttpServerResponse response)- 
Methods inherited from class org.wildfly.security.mechanism.http.UsernamePasswordAuthenticationMechanismauthenticate, authorize, fail, succeed
 - 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface org.wildfly.security.http.HttpServerAuthenticationMechanismdispose, getNegotiatedProperty, getNegotiationProperty
 
- 
 
- 
- 
- 
Field Detail- 
SILENTstatic final String SILENT - See Also:
- Constant Field Values
 
 - 
CHALLENGE_PREFIXprivate static final String CHALLENGE_PREFIX - See Also:
- Constant Field Values
 
 - 
PREFIX_LENGTHprivate static final int PREFIX_LENGTH 
 - 
includeCharsetprivate final boolean includeCharset 
 - 
configuredRealmprivate final String configuredRealm 
 - 
silentprivate final boolean silent If silent is true then this mechanism will only take effect if there is an Authorization header. This allows you to combine basic auth with form auth, so human users will use form based auth, but allows programmatic clients to login using basic auth.
 
- 
 - 
Constructor Detail- 
BasicAuthenticationMechanismBasicAuthenticationMechanism(CallbackHandler callbackHandler, String configuredRealm, boolean silent, boolean includeCharset) Construct a new instance ofBasicAuthenticationMechanism.- Parameters:
- callbackHandler- the- CallbackHandlerto use to verify the supplied credentials and to notify to establish the current identity.
- configuredRealm- a configured realm name from the configuration.
- includeCharset- should the charset be included in the challenge.
 
 
- 
 - 
Method Detail- 
getMechanismNamepublic String getMechanismName() Description copied from interface:HttpServerAuthenticationMechanismGet the name of this mechanism, where appropriate this should be the IANA registered name.- Returns:
- the name of the mechanism.
- See Also:
- HttpServerAuthenticationMechanism.getMechanismName()
 
 - 
evaluateRequestpublic 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.- Parameters:
- request- representation of the HTTP request.
- Throws:
- HttpAuthenticationException
- See Also:
- HttpServerAuthenticationMechanism.evaluateRequest(HttpServerRequest)
 
 - 
prepareResponseprivate void prepareResponse(HttpServerRequest request, String realmName, HttpServerResponse response) 
 
- 
 
-