ovok_sdk.auth.client_credentials

Machine-client authentication with the OAuth client-credentials grant.

  • Stable unknown
  • Release candidate since 0.1.0-rc.4
  • Development since 0.1.0-dev.25+2ba84b0

Machine-client authentication with the OAuth client-credentials grant.

ClientCredentials

ClientCredentials(
    endpoint: TokenEndpoint,
    client: MachineClient,
    clock: Clock = epoch_ms,
)

A machine client's own token, fetched from the OAuth endpoint and renewed before it expires.

Parameters

NameTypeDefaultDescription
endpointTokenEndpointThe OAuth token endpoint.
clientMachineClientThe machine client's credentials.
clockClockepoch_msCurrent time in epoch milliseconds.

access_token()

access_token() -> str

Return a fresh access token, requesting a new one when the current one is stale.

refresh()

refresh() -> bool

Request a new token.

Returns

  • bool: Always True; a failed request raises instead.

Last updated on

On this page