Class ClientRegistration
java.lang.Object
com.codename1.backend.security.oauth2.client.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.
ClientRegistration google = CommonOAuth2Provider.GOOGLE.getBuilder("google")
.clientId(id).clientSecret(secret).build();
ClientRegistration own = ClientRegistration.withRegistrationId("acme")
.clientId("web").clientSecret(secret)
.issuerUri("https://id.example.com")
.scope("openid", "profile", "email").build();
A registration that names an issuerUri and not the endpoints has them read
from the issuer's metadata the first time a user signs in through it.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds aClientRegistration.static interfaceWhere a client secret comes from when it is not a fixed text: Sign in with Apple's is a token this server signs.static final classWhere the provider is. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionWhat a login page calls this provider.The fixed secret, or null when there is none or it is supplied; seeresolveClientSecret().Where the provider sends the user back: an address, or a template with{baseUrl}and{registrationId}in it.FORM_POST, or null for the provider's default, a redirect.The secret to send now: the fixed one, or what the supplier gives.toString()Returns a string representation of the object.static ClientRegistration.BuilderwithClientRegistration(ClientRegistration registration) A builder that starts as a copy ofregistration.static ClientRegistration.BuilderwithRegistrationId(String registrationId) A registration under this id, which is the last part of the two paths a sign-in through it uses.
-
Field Details
-
FORM_POST
Theresponse_modethat has the provider answer with a form the browser posts, rather than a redirect.- See Also:
-
-
Method Details
-
withRegistrationId
A registration under this id, which is the last part of the two paths a sign-in through it uses. -
withClientRegistration
A builder that starts as a copy ofregistration. -
getRegistrationId
-
getClientId
-
getClientSecret
The fixed secret, or null when there is none or it is supplied; seeresolveClientSecret(). -
resolveClientSecret
The secret to send now: the fixed one, or what the supplier gives.- Throws:
IOException
-
getClientAuthenticationMethod
-
getAuthorizationGrantType
-
getRedirectUri
Where the provider sends the user back: an address, or a template with{baseUrl}and{registrationId}in it. -
getScopes
-
getClientName
What a login page calls this provider. -
getResponseMode
-
getProviderDetails
-
toString
Description copied from class:ObjectReturns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method. The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of: getClass().getName() + '@' + Integer.toHexString(hashCode())
-