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
ConstructorsConstructorDescriptionCrowdSSOAuthenticationToken(String ssoToken) 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 TypeMethodDescriptionThe credentials that prove the principal is correct.The identity of the principal being authenticated.voidsetAuthenticated(boolean isAuthenticated) Disallow setAuthenticated(true).Methods inherited from class org.springframework.security.authentication.AbstractAuthenticationToken
equals, eraseCredentials, getAuthorities, getDetails, getName, hashCode, isAuthenticated, setDetails, toString
-
Constructor Details
-
CrowdSSOAuthenticationToken
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
The credentials that prove the principal is correct. This is usually a password, but could be anything relevant to theAuthenticationManager. Callers are expected to populate the credentials.- Returns:
- the credentials that prove the identity of the
Principal
-
getPrincipal
The identity of the principal being authenticated. This is usually a username. Callers are expected to populate the principal.- Returns:
- the
Principalbeing authenticated
-
setAuthenticated
Disallow setAuthenticated(true).Use constructor containing GrantedAuthority[]s instead.
- Specified by:
setAuthenticatedin interfaceorg.springframework.security.core.Authentication- Overrides:
setAuthenticatedin classorg.springframework.security.authentication.AbstractAuthenticationToken- Parameters:
isAuthenticated- must befalse.- Throws:
IllegalArgumentException- throwd if isAuthenticated paramater is set totrue.
-