org.apache.shindig.auth
Class AnonymousAuthenticationHandler

java.lang.Object
  extended by org.apache.shindig.auth.AnonymousAuthenticationHandler
All Implemented Interfaces:
AuthenticationHandler

public class AnonymousAuthenticationHandler
extends Object
implements AuthenticationHandler

Handled Anonymous Authentication, including returning an "anonymous" security token.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.shindig.auth.AuthenticationHandler
AuthenticationHandler.InvalidAuthenticationException
 
Field Summary
static String ALLOW_UNAUTHENTICATED
           
 
Fields inherited from interface org.apache.shindig.auth.AuthenticationHandler
STASHED_BODY
 
Constructor Summary
AnonymousAuthenticationHandler(boolean allowUnauthenticated)
           
 
Method Summary
 String getName()
           
 SecurityToken getSecurityTokenFromRequest(javax.servlet.http.HttpServletRequest request)
          Produce a security token extracted from the HTTP request.
 String getWWWAuthenticateHeader(String realm)
          Return a String to be used for a WWW-Authenticate header.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALLOW_UNAUTHENTICATED

public static final String ALLOW_UNAUTHENTICATED
See Also:
Constant Field Values
Constructor Detail

AnonymousAuthenticationHandler

@Inject
public AnonymousAuthenticationHandler(boolean allowUnauthenticated)
Method Detail

getName

public String getName()
Specified by:
getName in interface AuthenticationHandler
Returns:
The name of the authentication handler. This value is bound to the security token and can be used to determine the authentication mechanism by which the security token was created. The value is expected to be one of the values in AuthenticationMode but string is used here to allow containers to have custom authentication modes

getSecurityTokenFromRequest

public SecurityToken getSecurityTokenFromRequest(javax.servlet.http.HttpServletRequest request)
Description copied from interface: AuthenticationHandler
Produce a security token extracted from the HTTP request.

Specified by:
getSecurityTokenFromRequest in interface AuthenticationHandler
Parameters:
request - The request to extract a token from.
Returns:
A valid security token for the request, or null if it wasn't possible to authenticate.

getWWWAuthenticateHeader

public String getWWWAuthenticateHeader(String realm)
Description copied from interface: AuthenticationHandler
Return a String to be used for a WWW-Authenticate header. This will be called if the call to getSecurityTokenFromRequest returns null. If non-null/non-blank it will be added to the Response. See Section 6.1.3 of the Portable Contacts Specification

Specified by:
getWWWAuthenticateHeader in interface AuthenticationHandler
Parameters:
realm - the name of the realm to use for the authenticate header
Returns:
Header value for a WWW-Authenticate Header


Copyright © 2007-2012. All Rights Reserved.