Class OAuth2SessionAuthenticationToken
- java.lang.Object
-
- org.springframework.security.authentication.AbstractAuthenticationToken
-
- com.broadleafcommerce.auth.user.session.OAuth2SessionAuthenticationToken
-
- All Implemented Interfaces:
Serializable
,Principal
,org.springframework.security.core.Authentication
,org.springframework.security.core.CredentialsContainer
public class OAuth2SessionAuthenticationToken extends org.springframework.security.authentication.AbstractAuthenticationToken
AnAuthentication
implementation that is designed for simple presentation of an OAuth2 clientId, and JWT session token.- Author:
- Nick Crum (ncrum)
- See Also:
OAuth2SessionAuthenticationProvider
, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description OAuth2SessionAuthenticationToken(OAuth2SessionToken sessionToken, Collection<? extends org.springframework.security.core.GrantedAuthority> authorities)
This constructor should only be used byAuthenticationManager
orAuthenticationProvider
implementations that are satisfied with producing a trusted (i.e.OAuth2SessionAuthenticationToken(OAuth2SessionToken sessionToken, Collection<? extends org.springframework.security.core.GrantedAuthority> authorities, Object principal)
This constructor should only be used byAuthenticationManager
orAuthenticationProvider
implementations that are satisfied with producing a trusted (i.e.OAuth2SessionAuthenticationToken(String clientId, String tokenValue)
This constructor can be safely used by any code that wishes to create aOAuth2ClientAuthenticationToken
, as theAbstractAuthenticationToken.isAuthenticated()
will returnfalse
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getClientId()
The OAuth2 client ID.Object
getCredentials()
Object
getPrincipal()
OAuth2SessionToken
getToken()
The JWT token from the BLSID-[client_id] session cookie.String
getTokenValue()
-
Methods inherited from class org.springframework.security.authentication.AbstractAuthenticationToken
equals, eraseCredentials, getAuthorities, getDetails, getName, hashCode, isAuthenticated, setAuthenticated, setDetails, toString
-
-
-
-
Constructor Detail
-
OAuth2SessionAuthenticationToken
public OAuth2SessionAuthenticationToken(String clientId, String tokenValue)
This constructor can be safely used by any code that wishes to create aOAuth2ClientAuthenticationToken
, as theAbstractAuthenticationToken.isAuthenticated()
will returnfalse
.
-
OAuth2SessionAuthenticationToken
public OAuth2SessionAuthenticationToken(OAuth2SessionToken sessionToken, Collection<? extends org.springframework.security.core.GrantedAuthority> authorities)
This constructor should only be used byAuthenticationManager
orAuthenticationProvider
implementations that are satisfied with producing a trusted (i.e.AbstractAuthenticationToken.isAuthenticated()
=true
) authentication token.- Parameters:
authorities
-
-
OAuth2SessionAuthenticationToken
public OAuth2SessionAuthenticationToken(OAuth2SessionToken sessionToken, Collection<? extends org.springframework.security.core.GrantedAuthority> authorities, Object principal)
This constructor should only be used byAuthenticationManager
orAuthenticationProvider
implementations that are satisfied with producing a trusted (i.e.AbstractAuthenticationToken.isAuthenticated()
=true
) authentication token.- Parameters:
authorities
-
-
-
Method Detail
-
getTokenValue
public String getTokenValue()
-
getCredentials
public Object getCredentials()
-
getPrincipal
public Object getPrincipal()
-
getClientId
public String getClientId()
The OAuth2 client ID.
-
getToken
public OAuth2SessionToken getToken()
The JWT token from the BLSID-[client_id] session cookie.
-
-