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 AppleClientSecret | The 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 AuthorizationRequestRepository | Where an OAuth2AuthorizationRequest waits while the user is at the identity provider. |
class ClientRegistration | This 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 ClientRegistrationRepository | The identity providers this server signs users in through. |
class ClientRegistrations | Registrations read from the server’s configuration, and from an issuer’s metadata. |
enum CommonOAuth2Provider | The settings of the identity providers most applications sign in through, so that a registration needs only the id and secret the provider issued. |
class CookieOAuth2AuthorizationRequestRepository | Keeps 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 DefaultAuthorizationCodeTokenResponseClient | The exchange over the runtime’s HTTP client, which parks the request’s thread while the provider answers. |
class DefaultOAuth2AuthorizationRequestResolver | Starts a sign-in for a GET of /oauth2/authorization/{registrationId}. |
class DefaultOAuth2User | An OAuth2User that holds what it is given. |
class DefaultOAuth2UserService | The 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 DefaultOidcUser | An OidcUser that holds what it is given. |
interface FederatedIdentityRepository | Which 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 HttpSessionOAuth2AuthorizationRequestRepository | Keeps the request in the HTTP session: the default, for every provider that answers with a redirect. |
class InMemoryClientRegistrationRepository | Registrations given when the server starts. |
class InMemoryFederatedIdentityRepository | Identities kept in this process: gone when it stops, and unknown to any other. |
class JdbcFederatedIdentityRepository | Identities kept in the server’s database, in the cn1_federated_identity table of SecuritySchema. |
class LinkingOAuth2UserService | Signs the user of an identity provider in as a user of the application’s own. |
class OAuth2AccessTokenResponse | What a token endpoint answered a successful exchange with. |
interface OAuth2AccessTokenResponseClient | Exchanges an authorization code for tokens at the provider’s token endpoint. |
class OAuth2AuthenticationToken | A user who signed in through an identity provider. |
class OAuth2AuthorizationRequest | One 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 OAuth2AuthorizationRequestResolver | Decides whether a request starts a sign-in at an identity provider, and what is asked of the provider when it does. |
interface OAuth2User | A user as an identity provider described them. |
class OAuth2UserRequest | What an OAuth2UserService is asked with: the provider the user signed in through, and the tokens it issued. |
interface OAuth2UserService | Makes the user of a sign-in through an identity provider. |
class OidcIdTokenDecoderFactory | Makes, and keeps, the decoder that verifies the ID tokens of one registration. |
interface OidcUser | A user an OpenID Connect provider vouched for with an ID token. |
class OidcUserRequest | An OAuth2UserRequest for a provider that also issued an ID token, which has been verified by the time a service sees it. |
class OidcUserService | The 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. |