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

public final class OAuth2TokenContext

  1. Object
  2. OAuth2TokenContext
One token about to be signed, as an OAuth2TokenCustomizer sees it.

Fields

public static final String ACCESS_TOKEN = "access_token"getTokenType of an access token.
public static final String ID_TOKEN = "id_token"getTokenType of an ID token.

Methods

public String getTokenType()ACCESS_TOKEN or ID_TOKEN.
public RegisteredClient getRegisteredClient()
public OAuth2Authorization getAuthorization()The grant the token is issued under; null for client_credentials, which keeps none.
public String getPrincipalName()The user, or for client_credentials the client’s id.
public String getAuthorizationGrantType()The grant_type of the request the token answers.
public Set<String> getAuthorizedScopes()
public JwtClaimsSet.Builder getClaims()The claims so far, to add to or change.

Inherited methods

Field details

ACCESS_TOKEN

public static final String ACCESS_TOKEN = "access_token"
getTokenType of an access token.

ID_TOKEN

public static final String ID_TOKEN = "id_token"
getTokenType of an ID token.

Method details

getTokenType

public String getTokenType()

getRegisteredClient

public RegisteredClient getRegisteredClient()

getAuthorization

public OAuth2Authorization getAuthorization()
The grant the token is issued under; null for client_credentials, which keeps none. Its attribute authorities lists what the user had been granted when they approved.

getPrincipalName

public String getPrincipalName()
The user, or for client_credentials the client’s id.

getAuthorizationGrantType

public String getAuthorizationGrantType()
The grant_type of the request the token answers.

getAuthorizedScopes

public Set<String> getAuthorizedScopes()

getClaims

public JwtClaimsSet.Builder getClaims()
The claims so far, to add to or change.