com.atlassian.seraph.auth
Enum LoginReason

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

public enum LoginReason
extends Enum<LoginReason>

An enumeration of why a login attempt has failed


Enum Constant Summary
AUTHENTICATED_FAILED
          The user could not be authenticated.
AUTHENTICATION_DENIED
          The user is not allowed to even attempt a login.
AUTHORISATION_FAILED
          The user could not be authorised.
OK
          The login was OK
OUT
          This indicates that person has in fact logged "out"
 
Field Summary
static String REQUEST_ATTR_NAME
          The name of the request attribute set by Seraph to indicate how the login process went
static String X_SERAPH_LOGIN_REASON
          The name of the Header set by Seraph to indicate how the login process went
 
Method Summary
 boolean isStamped(javax.servlet.http.HttpServletRequest httpServletRequest)
          Checks if the given request has been stamped with this login reason.
 LoginReason stampRequestResponse(javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse)
          This will stamp an attribute to the request called "com.atlassian.seraph.auth.LoginReason" to the toString() of the enum and will also add an "X-Seraph-LoginReason" to this value

Once a request/response is stamped, it wont be stamped again

static LoginReason valueOf(String name)
          Returns the enum constant of this type with the specified name.
static LoginReason[] 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

AUTHENTICATION_DENIED

public static final LoginReason AUTHENTICATION_DENIED
The user is not allowed to even attempt a login. They are not allowed to by the ElevatedSecurityGuard


AUTHENTICATED_FAILED

public static final LoginReason AUTHENTICATED_FAILED
The user could not be authenticated.


AUTHORISATION_FAILED

public static final LoginReason AUTHORISATION_FAILED
The user could not be authorised.


OUT

public static final LoginReason OUT
This indicates that person has in fact logged "out"


OK

public static final LoginReason OK
The login was OK

Field Detail

X_SERAPH_LOGIN_REASON

public static final String X_SERAPH_LOGIN_REASON
The name of the Header set by Seraph to indicate how the login process went

See Also:
Constant Field Values

REQUEST_ATTR_NAME

public static final String REQUEST_ATTR_NAME
The name of the request attribute set by Seraph to indicate how the login process went

Method Detail

values

public static LoginReason[] 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 (LoginReason c : LoginReason.values())
    System.out.println(c);

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

valueOf

public static LoginReason 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

stampRequestResponse

public LoginReason stampRequestResponse(javax.servlet.http.HttpServletRequest httpServletRequest,
                                        javax.servlet.http.HttpServletResponse httpServletResponse)
This will stamp an attribute to the request called "com.atlassian.seraph.auth.LoginReason" to the toString() of the enum and will also add an "X-Seraph-LoginReason" to this value

Once a request/response is stamped, it wont be stamped again

Parameters:
httpServletRequest - the request
httpServletResponse - the response
Returns:
this to give us a nice builder pattern

isStamped

public boolean isStamped(javax.servlet.http.HttpServletRequest httpServletRequest)
Checks if the given request has been stamped with this login reason.

Parameters:
httpServletRequest - the request
Returns:
true if the request has been stamped, false if otherwise
See Also:
stampRequestResponse(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)


Copyright © 2013 Atlassian. All Rights Reserved.