com.atlassian.seraph.auth
Enum AuthType

java.lang.Object
  extended by java.lang.Enum<AuthType>
      extended by com.atlassian.seraph.auth.AuthType
All Implemented Interfaces:
Serializable, Comparable<AuthType>

public enum AuthType
extends Enum<AuthType>

If an authType is specified by the user that doesn't match a specific auth type as defined by this enum, 'NONE' will be returned.

Since:
2.2

Enum Constant Summary
ANY
          This is sort of like a combination of all three above.
BASIC
          The user is either presenting HTTP BASIC Authentication credentials or wants the application to initial a BASIC Auth challenge.
COOKIE
          The user is presenting a session cookie that they expect to work.
NONE
          There has been no authentication type specified for this request.
 
Field Summary
static String DEFAULT_ATTRIBUTE
           
 
Method Summary
static AuthType getAuthTypeInformation(javax.servlet.http.HttpServletRequest request, SecurityConfig config)
           
static AuthType valueOf(String name)
          Returns the enum constant of this type with the specified name.
static AuthType[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

NONE

public static final AuthType NONE
There has been no authentication type specified for this request. If the user has provided an invalid cookie they will be allowed to view the page as an anonymous user.


COOKIE

public static final AuthType COOKIE
The user is presenting a session cookie that they expect to work. If it doesn't work they want to know that, rather than silently proceeding as an anonymous user. In practice this means they should get a 401 or 403 if their session has expired.


BASIC

public static final AuthType BASIC
The user is either presenting HTTP BASIC Authentication credentials or wants the application to initial a BASIC Auth challenge.


ANY

public static final AuthType ANY
This is sort of like a combination of all three above. If you don't present BASIC Auth or a session cookie then you will proceed anonymous. If you present one of those and they are invalid then you get a 401 or 403 instead. The difference between NONE and ANY is that with NONE you can *think* you are logging in but end up anonymous because your session has expired. Remote API users (like scripts) don't notice this and just get different results. They would prefer to get an obvious response code telling them that something isn't quite right.

Field Detail

DEFAULT_ATTRIBUTE

public static final String DEFAULT_ATTRIBUTE
See Also:
Constant Field Values
Method Detail

values

public static AuthType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (AuthType c : AuthType.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static AuthType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

getAuthTypeInformation

public static AuthType getAuthTypeInformation(javax.servlet.http.HttpServletRequest request,
                                              SecurityConfig config)


Copyright © 2013 Atlassian. All Rights Reserved.