Class BasicAuthenticator
- java.lang.Object
-
- org.apache.catalina.valves.ValveBase
-
- org.apache.catalina.authenticator.AuthenticatorBase
-
- org.apache.catalina.authenticator.BasicAuthenticator
-
- All Implemented Interfaces:
Authenticator
,Contained
,Lifecycle
,Valve
,GlassFishValve
public class BasicAuthenticator extends AuthenticatorBase
An Authenticator and Valve implementation of HTTP BASIC Authentication, as outlined in RFC 2617: "HTTP Authentication: Basic and Digest Access Authentication."- Version:
- $Revision: 1.7 $ $Date: 2007/05/05 05:31:52 $
- Author:
- Craig R. McClanahan
-
-
Field Summary
Fields Modifier and Type Field Description protected static String
info
Descriptive information about this implementation.-
Fields inherited from class org.apache.catalina.authenticator.AuthenticatorBase
alwaysUseSession, AUTH_HEADER_NAME, cache, changeSessionIdOnAuthentication, context, disableProxyCaching, entropy, random, randomClass, REALM_NAME, securePagesWithPragma, SESSION_ID_BYTES, sso
-
Fields inherited from class org.apache.catalina.valves.ValveBase
container, controller, debug, domain, lifecycle, log, next, oname, rb, started
-
Fields inherited from interface org.glassfish.web.valve.GlassFishValve
END_PIPELINE, INVOKE_NEXT
-
Fields inherited from interface org.apache.catalina.Lifecycle
AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, INIT_EVENT, START_EVENT, STOP_EVENT
-
-
Constructor Summary
Constructors Constructor Description BasicAuthenticator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
authenticate(HttpRequest request, HttpResponse response, LoginConfig config)
Authenticate the user making this request, based on the specified login configuration.protected String
getAuthMethod()
String
getInfo()
Return descriptive information about this Valve implementation.protected char[]
parsePassword(String authorization)
Parse the password from the specified authorization credentials.protected String
parseUsername(String authorization)
Parse the username from the specified authorization credentials.-
Methods inherited from class org.apache.catalina.authenticator.AuthenticatorBase
associate, doLogin, generateSessionId, getAlwaysUseSession, getCache, getContainer, getDebug, getDisableProxyCaching, getEntropy, getRandom, getRandomClass, getRealmName, getSession, getSession, getSingleSignOn, invoke, isChangeSessionIdOnAuthentication, isSecurePagesWithPragma, log, log, login, logout, postInvoke, register, setAlwaysUseSession, setCache, setChangeSessionIdOnAuthentication, setContainer, setDebug, setDisableProxyCaching, setEntropy, setRandomClass, setRealmName, setSecurePagesWithPragma, setSingleSignOn, start, stop
-
Methods inherited from class org.apache.catalina.valves.ValveBase
addLifecycleListener, backgroundProcess, createObjectName, event, findLifecycleListeners, getController, getDomain, getNext, getObjectName, getParentName, invoke, isStarted, removeLifecycleListener, setController, setNext, setObjectName
-
-
-
-
Field Detail
-
info
protected static final String info
Descriptive information about this implementation.- See Also:
- Constant Field Values
-
-
Method Detail
-
getInfo
public String getInfo()
Return descriptive information about this Valve implementation.- Specified by:
getInfo
in interfaceGlassFishValve
- Specified by:
getInfo
in interfaceValve
- Overrides:
getInfo
in classAuthenticatorBase
-
authenticate
public boolean authenticate(HttpRequest request, HttpResponse response, LoginConfig config) throws IOException
Authenticate the user making this request, based on the specified login configuration. Returntrue
if any specified constraint has been satisfied, orfalse
if we have created a response challenge already.- Specified by:
authenticate
in classAuthenticatorBase
- Parameters:
request
- Request we are processingresponse
- Response we are creatingconfig
- Login configuration describing how authentication should be performed- Throws:
IOException
- if an input/output error occurs
-
parseUsername
protected String parseUsername(String authorization)
Parse the username from the specified authorization credentials. If none can be found, returnnull
.- Parameters:
authorization
- Authorization credentials from this request
-
parsePassword
protected char[] parsePassword(String authorization)
Parse the password from the specified authorization credentials. If none can be found, returnnull
.- Parameters:
authorization
- Authorization credentials from this request
-
getAuthMethod
protected String getAuthMethod()
- Specified by:
getAuthMethod
in classAuthenticatorBase
-
-