Class BearerTokenAuthentication

  • All Implemented Interfaces:
    java.io.Serializable, java.security.Principal, org.springframework.security.core.Authentication, org.springframework.security.core.CredentialsContainer

    @Transient
    public class BearerTokenAuthentication
    extends AbstractOAuth2TokenAuthenticationToken<org.springframework.security.oauth2.core.OAuth2AccessToken>
    An Authentication token that represents a successful authentication as obtained through a bearer token.
    Since:
    5.2
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      BearerTokenAuthentication​(org.springframework.security.oauth2.core.OAuth2AuthenticatedPrincipal principal, org.springframework.security.oauth2.core.OAuth2AccessToken credentials, java.util.Collection<? extends org.springframework.security.core.GrantedAuthority> authorities)
      Constructs a BearerTokenAuthentication with the provided arguments
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Map<java.lang.String,​java.lang.Object> getTokenAttributes()
      Returns the attributes of the access token.
      • Methods inherited from class org.springframework.security.authentication.AbstractAuthenticationToken

        equals, eraseCredentials, getAuthorities, getDetails, getName, hashCode, isAuthenticated, setAuthenticated, 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 Detail

      • BearerTokenAuthentication

        public BearerTokenAuthentication​(org.springframework.security.oauth2.core.OAuth2AuthenticatedPrincipal principal,
                                         org.springframework.security.oauth2.core.OAuth2AccessToken credentials,
                                         java.util.Collection<? extends org.springframework.security.core.GrantedAuthority> authorities)
        Constructs a BearerTokenAuthentication with the provided arguments
        Parameters:
        principal - The OAuth 2.0 attributes
        credentials - The verified token
        authorities - The authorities associated with the given token