Class JwtBearerGrant
java.lang.Object
com.codename1.backend.security.oauth2.client.credentials.JwtBearerGrant
- All Implemented Interfaces:
AccessTokenGrant
The JWT bearer grant of RFC 7523 section 2.1: this server signs an assertion with a service account's private key and exchanges it for an access token. No client secret exists; the key is the credential.
It is how Google service accounts authenticate (see
GoogleServiceAccountCredentials), and Salesforce, DocuSign and others accept
it the same way. Every exchange signs a new assertion, valid for
assertionLifetimeSeconds (one hour by default, the most Google accepts) and
carrying a fresh jti.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic JwtBearerGrant.Builderfetch()Exchanges the credentials for a new token.toString()Returns a string representation of the object.
-
Field Details
-
GRANT_TYPE
-
-
Method Details
-
builder
- Parameters:
tokenUri- the token endpoint the assertion is exchanged atissuer-iss: the service account, such as its client emailsigningKey- the service account's private key; its id, if it has one, goes into the header askid
-
fetch
Description copied from interface:AccessTokenGrantExchanges the credentials for a new token.- Specified by:
fetchin interfaceAccessTokenGrant
-
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())
-