Class CrowdSSOAuthenticationToken

java.lang.Object
org.springframework.security.authentication.AbstractAuthenticationToken
com.atlassian.crowd.integration.springsecurity.CrowdSSOAuthenticationToken
All Implemented Interfaces:
Serializable, Principal, org.springframework.security.core.Authentication, org.springframework.security.core.CredentialsContainer

public class CrowdSSOAuthenticationToken extends org.springframework.security.authentication.AbstractAuthenticationToken
A CrowdSSOAuthenticationToken can be used to represent an authentication request consisting of the Crowd SSO Token String (credential) and HTTP ValidationFactors (details).

It can also be used to represent a token for successful authentication consisting of the CrowdUserDetails (principal), the Crowd SSO Token String (credential) and a collection of Group names the authenticated user is a member of (GrantedAuthorities).

See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Use constructor to create an unauthenticated SSO token.
    CrowdSSOAuthenticationToken(org.springframework.security.core.userdetails.UserDetails principal, String ssoToken, Collection<org.springframework.security.core.GrantedAuthority> authorities)
     
    CrowdSSOAuthenticationToken(org.springframework.security.core.userdetails.UserDetails principal, String ssoToken, org.springframework.security.core.GrantedAuthority[] authorities)
    Use this constructor to create an authenticated SSO token.
  • Method Summary

    Modifier and Type
    Method
    Description
    The credentials that prove the principal is correct.
    The identity of the principal being authenticated.
    void
    setAuthenticated(boolean isAuthenticated)
    Disallow setAuthenticated(true).

    Methods inherited from class org.springframework.security.authentication.AbstractAuthenticationToken

    equals, eraseCredentials, getAuthorities, getDetails, getName, hashCode, isAuthenticated, setDetails, toString

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface java.security.Principal

    implies
  • Constructor Details

    • CrowdSSOAuthenticationToken

      public CrowdSSOAuthenticationToken(String ssoToken)
      Use constructor to create an unauthenticated SSO token.
      Parameters:
      ssoToken - token string.
    • CrowdSSOAuthenticationToken

      public CrowdSSOAuthenticationToken(org.springframework.security.core.userdetails.UserDetails principal, String ssoToken, org.springframework.security.core.GrantedAuthority[] authorities)
      Use this constructor to create an authenticated SSO token.

      This should only be used by the AuthenticationProvider.

      Parameters:
      principal - authenticated user.
      ssoToken - authenticated SSO token as credential.
      authorities - granted authorities.
    • CrowdSSOAuthenticationToken

      public CrowdSSOAuthenticationToken(org.springframework.security.core.userdetails.UserDetails principal, String ssoToken, Collection<org.springframework.security.core.GrantedAuthority> authorities)
  • Method Details

    • getCredentials

      public Object getCredentials()
      The credentials that prove the principal is correct. This is usually a password, but could be anything relevant to the AuthenticationManager. Callers are expected to populate the credentials.
      Returns:
      the credentials that prove the identity of the Principal
    • getPrincipal

      public Object getPrincipal()
      The identity of the principal being authenticated. This is usually a username. Callers are expected to populate the principal.
      Returns:
      the Principal being authenticated
    • setAuthenticated

      public void setAuthenticated(boolean isAuthenticated) throws IllegalArgumentException
      Disallow setAuthenticated(true).

      Use constructor containing GrantedAuthority[]s instead.

      Specified by:
      setAuthenticated in interface org.springframework.security.core.Authentication
      Overrides:
      setAuthenticated in class org.springframework.security.authentication.AbstractAuthenticationToken
      Parameters:
      isAuthenticated - must be false.
      Throws:
      IllegalArgumentException - throwd if isAuthenticated paramater is set to true.