Class AuthenticationState

java.lang.Object
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 Details

    • 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