|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.security.authentication.server.KerberosAuthenticationHandler
org.apache.hadoop.security.authentication.server.AltKerberosAuthenticationHandler
public abstract class AltKerberosAuthenticationHandler
The AltKerberosAuthenticationHandler
behaves exactly the same way as
the KerberosAuthenticationHandler
, except that it allows for an
alternative form of authentication for browsers while still using Kerberos
for Java access. This is an abstract class that should be subclassed
to allow a developer to implement their own custom authentication for browser
access. The alternateAuthenticate method will be called whenever a request
comes from a browser.
Field Summary | |
---|---|
static String |
NON_BROWSER_USER_AGENTS
Constant for the configuration property that indicates which user agents are not considered browsers (comma separated) |
static String |
TYPE
Constant that identifies the authentication mechanism. |
Fields inherited from class org.apache.hadoop.security.authentication.server.KerberosAuthenticationHandler |
---|
KEYTAB, NAME_RULES, PRINCIPAL |
Constructor Summary | |
---|---|
AltKerberosAuthenticationHandler()
|
Method Summary | |
---|---|
abstract AuthenticationToken |
alternateAuthenticate(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Subclasses should implement this method to provide the custom authentication to be used for browsers. |
AuthenticationToken |
authenticate(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
It enforces the the Kerberos SPNEGO authentication sequence returning an AuthenticationToken only after the Kerberos SPNEGO sequence has
completed successfully (in the case of Java access) and only after the
custom authentication implemented by the subclass in alternateAuthenticate
has completed successfully (in the case of browser access). |
String |
getType()
Returns the authentication type of the authentication handler, 'alt-kerberos'. |
void |
init(Properties config)
Initializes the authentication handler instance. |
protected boolean |
isBrowser(String userAgent)
This method parses the User-Agent String and returns whether or not it refers to a browser. |
Methods inherited from class org.apache.hadoop.security.authentication.server.KerberosAuthenticationHandler |
---|
destroy, getKeytab, getPrincipal, managementOperation |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String TYPE
public static final String NON_BROWSER_USER_AGENTS
Constructor Detail |
---|
public AltKerberosAuthenticationHandler()
Method Detail |
---|
public String getType()
getType
in interface AuthenticationHandler
getType
in class KerberosAuthenticationHandler
public void init(Properties config) throws javax.servlet.ServletException
KerberosAuthenticationHandler
AuthenticationFilter.init(javax.servlet.FilterConfig)
method.
init
in interface AuthenticationHandler
init
in class KerberosAuthenticationHandler
config
- configuration properties to initialize the handler.
javax.servlet.ServletException
- thrown if the handler could not be initialized.public AuthenticationToken authenticate(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException, AuthenticationException
AuthenticationToken
only after the Kerberos SPNEGO sequence has
completed successfully (in the case of Java access) and only after the
custom authentication implemented by the subclass in alternateAuthenticate
has completed successfully (in the case of browser access).
authenticate
in interface AuthenticationHandler
authenticate
in class KerberosAuthenticationHandler
request
- the HTTP client request.response
- the HTTP client response.
IOException
- thrown if an IO error occurred
AuthenticationException
- thrown if an authentication error occurredprotected boolean isBrowser(String userAgent)
userAgent
- The User-Agent String, or null if there isn't one
public abstract AuthenticationToken alternateAuthenticate(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException, AuthenticationException
request
- the HTTP client request.response
- the HTTP client response.
IOException
- thrown if an IO error occurs
AuthenticationException
- thrown if an authentication error occurs
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |