Backend API. Server-side code: this runs in a Codename One backend, not in the app on the device.

public class AnonymousAuthenticationToken

  1. Object
  2. AbstractAuthenticationToken
  3. AnonymousAuthenticationToken

ImplementsAuthentication

Who a request is from when nobody signed in: a principal called anonymousUser holding ROLE_ANONYMOUS, so authorization rules always have someone to ask about. authenticated() does not accept it.

Constructors

public AnonymousAuthenticationToken(String key, Object principal, Collection<? extends GrantedAuthority> authorities)

Methods

public int getKeyHash()The hash of the key the token was made with.
public Object getCredentials()What proves the principal is who it says: a password, usually, and null once it has been checked.
public Object getPrincipal()The identity: a username before authentication, and afterwards usually the UserDetails it was resolved to.

Inherited methods

Constructor details

AnonymousAuthenticationToken

public AnonymousAuthenticationToken(String key, Object principal, Collection<? extends GrantedAuthority> authorities)

Parameters

key String
what identifies the filter that made the token
principal Object
Not documented.
authorities Collection<? extends GrantedAuthority>
Not documented.

Method details

getKeyHash

public int getKeyHash()
The hash of the key the token was made with.

getCredentials

public Object getCredentials()
What proves the principal is who it says: a password, usually, and null once it has been checked.

getPrincipal

public Object getPrincipal()
The identity: a username before authentication, and afterwards usually the UserDetails it was resolved to.