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

public enum CommonOAuth2Provider

  1. Object
  2. Enum<CommonOAuth2Provider>
  3. CommonOAuth2Provider

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

CommonOAuth2Provider.GITHUB.getBuilder("github").clientId(id).clientSecret(secret).build();

Enum constants

GOOGLEGoogle, with OpenID Connect.
GITHUBGitHub, which is OAuth2 without OpenID Connect: the user is read from its API, and named by the numeric id.
MICROSOFTMicrosoft’s identity platform at its multi-tenant common endpoints, which accept accounts of any organisation and personal ones.
APPLESign in with Apple.

Methods

public static CommonOAuth2Provider[] values()
public static CommonOAuth2Provider valueOf(String name)
public abstract ClientRegistration.Builder getBuilder(String registrationId)A builder with the provider’s settings in it, wanting the client id and secret.
public static CommonOAuth2Provider of(String name)The provider of this name, in any case, or null.

Inherited methods

Enum constant details

GOOGLE

GOOGLE
Google, with OpenID Connect.

GITHUB

GITHUB

GitHub, which is OAuth2 without OpenID Connect: the user is read from its API, and named by the numeric id.

GitHub’s user says nothing of whether an address is verified, and may show none at all. The verified ones are listed at /user/emails, which the user:email scope asked for here opens; see ClientRegistration.ProviderDetails.getUserEmailsUri.

MICROSOFT

MICROSOFT
Microsoft’s identity platform at its multi-tenant common endpoints, which accept accounts of any organisation and personal ones. Tokens are issued under the address of the account’s own tenant, so the issuer is held to the tenant template rather than to one address; an application that admits one tenant only should also check the tid claim.

APPLE

APPLE
Sign in with Apple. Apple answers with a form the browser posts, and its client secret is a token signed with the key Apple issued: give the builder a ClientRegistration.Builder.clientSecretSupplier made by AppleClientSecret.

Method details

values

public static CommonOAuth2Provider[] values()

valueOf

public static CommonOAuth2Provider valueOf(String name)

getBuilder

public abstract ClientRegistration.Builder getBuilder(String registrationId)
A builder with the provider’s settings in it, wanting the client id and secret.

of

public static CommonOAuth2Provider of(String name)
The provider of this name, in any case, or null.