Backend API. Server-side code: this runs in a Codename One backend, not in the app on the device.
public interface Authentication
Known subtypesAbstractAuthenticationToken, AnonymousAuthenticationToken, RememberMeAuthenticationToken, UsernamePasswordAuthenticationToken, ApiKeyAuthenticationToken, OAuth2AuthenticationToken, BearerTokenAuthenticationToken, JwtAuthenticationToken, WebAuthnAuthentication
Who a request is from: a credential presented for checking, or – once an
AuthenticationManager has accepted it – the principal and what it may do.
A controller receives the current one by declaring a parameter of this type;
anywhere else it is SecurityContextHolder.getContext().getAuthentication().
Methods
public abstract Collection<? extends GrantedAuthority> getAuthorities() | What the principal has been granted; empty before authentication. |
public abstract Object getCredentials() | What proves the principal is who it says: a password, usually, and null once it has been checked. |
public abstract Object getDetails() | Anything else the mechanism recorded about the request, or null. |
public abstract Object getPrincipal() | The identity: a username before authentication, and afterwards usually the UserDetails it was resolved to. |
public abstract boolean isAuthenticated() | Whether this has been accepted. |
public abstract void setAuthenticated(boolean isAuthenticated) | Marks the token trusted or not. |
public abstract String getName() | The principal’s name. |
Method details
getAuthorities
public abstract Collection<? extends GrantedAuthority> getAuthorities()What the principal has been granted; empty before authentication.
getCredentials
public abstract Object getCredentials()What proves the principal is who it says: a password, usually, and null
once it has been checked.
getDetails
public abstract Object getDetails()Anything else the mechanism recorded about the request, or null.
getPrincipal
public abstract Object getPrincipal()The identity: a username before authentication, and afterwards usually the
UserDetails it was
resolved to.isAuthenticated
public abstract boolean isAuthenticated()Whether this has been accepted. A token a client merely presented is not.
setAuthenticated
public abstract void setAuthenticated(boolean isAuthenticated)Marks the token trusted or not. Implementations refuse
true from
outside: a trusted token is made by a constructor that says so.getName
public abstract String getName()The principal’s name.