com.atlassian.crowd.integration
Class AuthenticationState

java.lang.Object
  extended by com.atlassian.crowd.integration.AuthenticationState

public class AuthenticationState
extends Object

This class holds authentication state. In addition to knowing whether a user is authenticated or not, this class can optionally also contain the authenticated principal to save the caller the trouble of finding the principal in another way. In other words, the absence of a principal does not mean that the principal does not exist.

Since:
2.8.3

Method Summary
static AuthenticationState authenticated()
           
static AuthenticationState authenticated(Principal principal)
          Create successful authentication state containing a user.
 boolean equals(Object o)
           
 com.google.common.base.Optional<Principal> getAuthenticatedPrincipal()
           
 int hashCode()
           
 boolean isAuthenticated()
           
static AuthenticationState unauthenticated()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

authenticated

public static AuthenticationState authenticated(Principal principal)
Create successful authentication state containing a user.

Parameters:
principal - authenticate user
Returns:
successful authentication state containing a user

authenticated

public static AuthenticationState authenticated()
Returns:
successful authentication state

unauthenticated

public static AuthenticationState unauthenticated()
Returns:
unsuccessful authentication state

isAuthenticated

public boolean isAuthenticated()
Returns:
true if the user is authenticated

getAuthenticatedPrincipal

public com.google.common.base.Optional<Principal> getAuthenticatedPrincipal()
Returns:
the authenticated user if available

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2016 Atlassian. All Rights Reserved.