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

package com.codename1.backend.security.oauth2.server.authorization

An OAuth2 authorization server and OpenID Connect provider: the server that signs users in on behalf of clients and issues them tokens. The clients it knows, the grants it has made, its settings and keys, and the endpoints themselves.

Turned on with http.authorizationServer(...); see AuthorizationServerConfigurer. A server that does not call it carries none of this.

Types

class AuthorizationServerKeysThe keys an authorization server signs with.
class AuthorizationServerSettingsWho the authorization server is and where its endpoints are.
class ClientSettingsWhat is asked of one client beyond what OAuth2 asks of every client.
class InMemoryOAuth2AuthorizationServiceGrants kept in this process: gone when it stops, and unknown to any other.
class InMemoryRegisteredClientRepositoryClients given when the server starts, and kept in this process.
class JdbcOAuth2AuthorizationServiceGrants kept in the server’s database, in the cn1_oauth2_authorization and cn1_oauth2_token tables of SecuritySchema: what lets tokens outlive a restart, and several processes be one authorization server.
class JdbcRegisteredClientRepositoryClients kept in the server’s database, in the cn1_oauth2_registered_client table of SecuritySchema.
class OAuth2AuthorizationOne grant: a user – or, for the device grant, nobody yet – having let one client act with some scopes.
class OAuth2AuthorizationServerThe endpoints of an authorization server, each a method that takes a request and answers it.
interface OAuth2AuthorizationServiceWhere an authorization server keeps the grants it has made and the secrets it issued under them.
class OAuth2AuthorizationValidatorChecks a signed access token against its live authorization grant, including client-credentials grants.
class OAuth2TokenContextOne token about to be signed, as an OAuth2TokenCustomizer sees it.
interface OAuth2TokenCustomizerChanges the claims of the tokens an authorization server signs: adds the user’s roles to an access token, a tenant to an ID token.
interface OidcUserInfoMapperWhat an authorization server says of a user: the claims of the /userinfo answer and of an ID token, beyond sub.
class RegisteredClientA client this authorization server issues tokens to.
interface RegisteredClientRepositoryThe clients an authorization server knows.
class TokenSettingsHow long what is issued to one client lasts, in seconds.