Class AbstractAuthenticationToken

java.lang.Object
com.codename1.backend.security.AbstractAuthenticationToken
All Implemented Interfaces:
Authentication
Direct Known Subclasses:
AnonymousAuthenticationToken, ApiKeyAuthenticationToken, BearerTokenAuthenticationToken, JwtAuthenticationToken, OAuth2AuthenticationToken, RememberMeAuthenticationToken, UsernamePasswordAuthenticationToken, WebAuthnAuthentication

public abstract class AbstractAuthenticationToken extends Object implements Authentication
The parts every Authentication shares: its authorities, its details and the name read off its principal.
  • Constructor Details

    • AbstractAuthenticationToken

      protected AbstractAuthenticationToken(Collection<? extends GrantedAuthority> authorities)
      A token with these authorities; null for none.
  • Method Details

    • getAuthorities

      public Collection<GrantedAuthority> getAuthorities()
      Description copied from interface: Authentication
      What the principal has been granted; empty before authentication.
      Specified by:
      getAuthorities in interface Authentication
    • getName

      public String getName()
      Description copied from interface: Authentication
      The principal's name.
      Specified by:
      getName in interface Authentication
    • isAuthenticated

      public boolean isAuthenticated()
      Description copied from interface: Authentication
      Whether this has been accepted. A token a client merely presented is not.
      Specified by:
      isAuthenticated in interface Authentication
    • setAuthenticated

      public void setAuthenticated(boolean isAuthenticated)
      Description copied from interface: Authentication
      Marks the token trusted or not. Implementations refuse true from outside: a trusted token is made by a constructor that says so.
      Specified by:
      setAuthenticated in interface Authentication
    • getDetails

      public Object getDetails()
      Description copied from interface: Authentication
      Anything else the mechanism recorded about the request, or null.
      Specified by:
      getDetails in interface Authentication
    • setDetails

      public void setDetails(Object details)
      Records something more about the request this token came from.
    • eraseCredentials

      public void eraseCredentials()
      Drops the secret this token carried, once it has been checked. Called by ProviderManager on a token it accepted.
    • toString

      public String toString()
      Description copied from class: Object
      Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method. The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of: getClass().getName() + '@' + Integer.toHexString(hashCode())
      Overrides:
      toString in class Object