Class ApiKeyToken

java.lang.Object
org.springframework.security.authentication.AbstractAuthenticationToken
edu.ucsb.cs156.frontiers.config.ApiKeyToken
All Implemented Interfaces:
Serializable, Principal, org.springframework.security.core.Authentication, org.springframework.security.core.CredentialsContainer

public class ApiKeyToken extends org.springframework.security.authentication.AbstractAuthenticationToken
See Also:
  • Constructor Details

    • ApiKeyToken

      public ApiKeyToken(CourseApiKey key, User user, Collection<? extends org.springframework.security.core.GrantedAuthority> authorities)
      Creates a token with the supplied array of authorities.
      Parameters:
      authorities - the collection of GrantedAuthoritys for the principal represented by this authentication object.
  • Method Details

    • isAuthenticated

      public boolean isAuthenticated()
      Specified by:
      isAuthenticated in interface org.springframework.security.core.Authentication
      Overrides:
      isAuthenticated in class org.springframework.security.authentication.AbstractAuthenticationToken
    • getCredentials

      public Object getCredentials()
    • getPrincipal

      public User getPrincipal()
    • getName

      public String getName()
      Specified by:
      getName in interface Principal
      Overrides:
      getName in class org.springframework.security.authentication.AbstractAuthenticationToken