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 AccessTokenAn access token this server obtained to call another one.
interface AccessTokenGrantOne way of obtaining an access token: a grant against a token endpoint.
class AccessTokenProviderAn access token for calling another service, kept fresh.
class AccessTokenProvidersBuilds an AccessTokenProvider from configuration, so the credential lives in a secret store or the environment instead of in code.
class ClientCredentialsGrantThe OAuth2 client credentials grant (RFC 6749 section 4.4): this server authenticates as itself and receives a token for its own account.
class GoogleServiceAccountCredentialsA Google service account, read from the JSON key file the Cloud console downloads, as a JwtBearerGrant.
class JwtBearerGrantThe 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 TokenAcquisitionExceptionA token endpoint did not issue a token.
class TokenEndpointA token endpoint: where a grant posts its form, and how the answer is read.