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

public class RememberMeAuthenticationToken

  1. Object
  2. AbstractAuthenticationToken
  3. RememberMeAuthenticationToken

ImplementsAuthentication

Who a request is from when the user was recognized by a remember-me cookie rather than signing in during this session.

It is authenticated, so authenticated() accepts it. fullyAuthenticated() and isFullyAuthenticated() do not: what should ask for the password again – changing it, a payment – uses those. A session that started from the cookie keeps this type for as long as it lasts.

Constructors

public RememberMeAuthenticationToken(String key, Object principal, Collection<? extends GrantedAuthority> authorities)
public RememberMeAuthenticationToken(String key, Object principal, Collection<? extends GrantedAuthority> authorities, boolean afterSecondFactor)

Methods

public int getKeyHash()The hash of the key the token was made with.
public boolean isAfterSecondFactor()Whether the sign-in that issued the cookie passed a second factor.
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

RememberMeAuthenticationToken

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

Parameters

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

RememberMeAuthenticationToken

public RememberMeAuthenticationToken(String key, Object principal, Collection<? extends GrantedAuthority> authorities, boolean afterSecondFactor)

Parameters

key String
what identifies the services that made the token
principal Object
Not documented.
authorities Collection<? extends GrantedAuthority>
Not documented.
afterSecondFactor boolean
whether the cookie was issued by a sign-in that passed a second factor; see isAfterSecondFactor

Method details

getKeyHash

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

isAfterSecondFactor

public boolean isAfterSecondFactor()
Whether the sign-in that issued the cookie passed a second factor. On a chain that asks for one, a user who has a second factor is recognized by their cookie only when this is true.

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.