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
The parts every
Authentication shares: its authorities, its details and
the name read off its principal.-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractAuthenticationToken(Collection<? extends GrantedAuthority> authorities) A token with these authorities; null for none. -
Method Summary
Modifier and TypeMethodDescriptionvoidDrops the secret this token carried, once it has been checked.What the principal has been granted; empty before authentication.Anything else the mechanism recorded about the request, or null.getName()The principal's name.booleanWhether this has been accepted.voidsetAuthenticated(boolean isAuthenticated) Marks the token trusted or not.voidsetDetails(Object details) Records something more about the request this token came from.toString()Returns a string representation of the object.Methods inherited from class Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Authentication
getCredentials, getPrincipal
-
Constructor Details
-
AbstractAuthenticationToken
A token with these authorities; null for none.
-
-
Method Details
-
getAuthorities
Description copied from interface:AuthenticationWhat the principal has been granted; empty before authentication.- Specified by:
getAuthoritiesin interfaceAuthentication
-
getName
Description copied from interface:AuthenticationThe principal's name.- Specified by:
getNamein interfaceAuthentication
-
isAuthenticated
public boolean isAuthenticated()Description copied from interface:AuthenticationWhether this has been accepted. A token a client merely presented is not.- Specified by:
isAuthenticatedin interfaceAuthentication
-
setAuthenticated
public void setAuthenticated(boolean isAuthenticated) Description copied from interface:AuthenticationMarks the token trusted or not. Implementations refusetruefrom outside: a trusted token is made by a constructor that says so.- Specified by:
setAuthenticatedin interfaceAuthentication
-
getDetails
Description copied from interface:AuthenticationAnything else the mechanism recorded about the request, or null.- Specified by:
getDetailsin interfaceAuthentication
-
setDetails
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 byProviderManageron a token it accepted. -
toString
Description copied from class:ObjectReturns 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())
-