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

public interface OAuth2TokenCustomizer

Changes the claims of the tokens an authorization server signs: adds the user’s roles to an access token, a tenant to an ID token.

http.authorizationServer(as -> as.tokenCustomizer(context -> {
    if (OAuth2TokenContext.ACCESS_TOKEN.equals(context.getTokenType())) {
        context.getClaims().claim("tenant", tenants.of(context.getPrincipalName()));
    }
}));

Methods

public abstract void customize(OAuth2TokenContext context)Called once for every token, before it is signed.

Method details

customize

public abstract void customize(OAuth2TokenContext context)
Called once for every token, before it is signed.