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.credentials
Access tokens this server obtains to call other services: the OAuth2 client credentials grant, the JWT bearer grant of RFC 7523, and Google service accounts, without a provider SDK.
A grant (ClientCredentialsGrant,
JwtBearerGrant) performs
one exchange; an
AccessTokenProvider
caches its token, refreshes it ahead of expiry, shares a refresh among
concurrent callers and backs off after a failure.
Types
class AccessToken | An access token this server obtained to call another one. |
interface AccessTokenGrant | One way of obtaining an access token: a grant against a token endpoint. |
class AccessTokenProvider | An access token for calling another service, kept fresh. |
class AccessTokenProviders | Builds an AccessTokenProvider from configuration, so the credential lives in a secret store or the environment instead of in code. |
class ClientCredentialsGrant | The OAuth2 client credentials grant (RFC 6749 section 4.4): this server authenticates as itself and receives a token for its own account. |
class GoogleServiceAccountCredentials | A Google service account, read from the JSON key file the Cloud console downloads, as a JwtBearerGrant. |
class JwtBearerGrant | 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. |
class TokenAcquisitionException | A token endpoint did not issue a token. |
class TokenEndpoint | A token endpoint: where a grant posts its form, and how the answer is read. |