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.client

Signing users in through another identity provider, with OAuth2 or OpenID Connect: this server as a client of Google, GitHub, Microsoft, Apple or any provider described by a ClientRegistration.

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

Types

class AppleClientSecretThe client secret of Sign in with Apple, which is not a text Apple issues but a token this server signs: an ES256 JWT naming the team, the client and Apple, signed with the .p8 key downloaded from the developer account.
interface AuthorizationRequestRepositoryWhere an OAuth2AuthorizationRequest waits while the user is at the identity provider.
class ClientRegistrationThis server as a client of one identity provider: the id and secret the provider issued it, the scopes it asks for, and where the provider’s endpoints are.
interface ClientRegistrationRepositoryThe identity providers this server signs users in through.
class ClientRegistrationsRegistrations read from the server’s configuration, and from an issuer’s metadata.
enum CommonOAuth2ProviderThe settings of the identity providers most applications sign in through, so that a registration needs only the id and secret the provider issued.
class CookieOAuth2AuthorizationRequestRepositoryKeeps the request in a cookie of its own, for a provider that answers with a form the browser posts (ClientRegistration.FORM_POST): Sign in with Apple.
class DefaultAuthorizationCodeTokenResponseClientThe exchange over the runtime’s HTTP client, which parks the request’s thread while the provider answers.
class DefaultOAuth2AuthorizationRequestResolverStarts a sign-in for a GET of /oauth2/authorization/{registrationId}.
class DefaultOAuth2UserAn OAuth2User that holds what it is given.
class DefaultOAuth2UserServiceThe user of a provider that is OAuth2 without OpenID Connect – GitHub: its attributes are what the provider’s user info address answers the access token with, and its name is the registration’s name attribute among them.
class DefaultOidcUserAn OidcUser that holds what it is given.
interface FederatedIdentityRepositoryWhich local user each identity at a provider is: the pairs of a registration’s id and the provider’s subject, each tied to one user name.
class HttpSessionOAuth2AuthorizationRequestRepositoryKeeps the request in the HTTP session: the default, for every provider that answers with a redirect.
class InMemoryClientRegistrationRepositoryRegistrations given when the server starts.
class InMemoryFederatedIdentityRepositoryIdentities kept in this process: gone when it stops, and unknown to any other.
class JdbcFederatedIdentityRepositoryIdentities kept in the server’s database, in the cn1_federated_identity table of SecuritySchema.
class LinkingOAuth2UserServiceSigns the user of an identity provider in as a user of the application’s own.
class OAuth2AccessTokenResponseWhat a token endpoint answered a successful exchange with.
interface OAuth2AccessTokenResponseClientExchanges an authorization code for tokens at the provider’s token endpoint.
class OAuth2AuthenticationTokenA user who signed in through an identity provider.
class OAuth2AuthorizationRequestOne user being sent to an identity provider: where to, and the three values that tie the provider’s answer back to this browser – the state, the nonce the ID token must repeat, and the PKCE verifier whose hash went with the request.
interface OAuth2AuthorizationRequestResolverDecides whether a request starts a sign-in at an identity provider, and what is asked of the provider when it does.
interface OAuth2UserA user as an identity provider described them.
class OAuth2UserRequestWhat an OAuth2UserService is asked with: the provider the user signed in through, and the tokens it issued.
interface OAuth2UserServiceMakes the user of a sign-in through an identity provider.
class OidcIdTokenDecoderFactoryMakes, and keeps, the decoder that verifies the ID tokens of one registration.
interface OidcUserA user an OpenID Connect provider vouched for with an ID token.
class OidcUserRequestAn OAuth2UserRequest for a provider that also issued an ID token, which has been verified by the time a service sees it.
class OidcUserServiceThe user of an OpenID Connect provider: the claims of the verified ID token, and – when the registration names a user info address and a scope that has claims there was granted – what that address adds to them.