Enum CommonOAuth2Provider
java.lang.Object
java.lang.Enum<CommonOAuth2Provider>
com.codename1.backend.security.oauth2.client.CommonOAuth2Provider
- All Implemented Interfaces:
Comparable<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 Constant Summary
Enum ConstantsEnum ConstantDescriptionSign in with Apple.GitHub, which is OAuth2 without OpenID Connect: the user is read from its API, and named by the numericid.Google, with OpenID Connect.Microsoft's identity platform at its multi-tenantcommonendpoints, which accept accounts of any organisation and personal ones. -
Method Summary
Modifier and TypeMethodDescriptionabstract ClientRegistration.BuildergetBuilder(String registrationId) A builder with the provider's settings in it, wanting the client id and secret.static CommonOAuth2ProviderThe provider of this name, in any case, or null.static CommonOAuth2ProviderReturns the enum constant of this type with the specified name.static CommonOAuth2Provider[]values()Returns an array containing the constants of this enum type, in the order they are declared.Methods inherited from class Enum
clone, compareTo, equals, getDeclaringClass, getEnumValues, hashCode, name, ordinal, setEnumValues, toString, valueOf
-
Enum Constant Details
-
GOOGLE
Google, with OpenID Connect. -
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 theuser:emailscope asked for here opens; seeClientRegistration.ProviderDetails.getUserEmailsUri(). -
MICROSOFT
Microsoft's identity platform at its multi-tenantcommonendpoints, 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 thetidclaim. -
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 aClientRegistration.Builder.clientSecretSuppliermade byAppleClientSecret.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
getBuilder
A builder with the provider's settings in it, wanting the client id and secret. -
of
The provider of this name, in any case, or null.
-