DeviceCheck.Token (device_check v0.3.0)

Copy Markdown View Source

DeviceCheck API token generation.

DeviceCheck uses a JWT signed with your DeviceCheck-enabled private key (ES256). The JWT is used directly as the Bearer token in API requests.

Summary

Functions

Returns a JWT token (same as generate_jwt for direct use).

Generate a JWT and return it with the expiration timestamp.

Generate a fresh ES256 JWT for DeviceCheck API authorization.

Types

jwt()

@type jwt() :: String.t()

Functions

access_token(opts \\ [])

@spec access_token(keyword()) :: {:ok, String.t()} | {:error, term()}

Returns a JWT token (same as generate_jwt for direct use).

access_token_with_expiry(opts \\ [])

@spec access_token_with_expiry(keyword()) ::
  {:ok, String.t(), integer()} | {:error, term()}

Generate a JWT and return it with the expiration timestamp.

generate_jwt(opts \\ [])

@spec generate_jwt(keyword()) :: {:ok, jwt()} | {:error, term()}

Generate a fresh ES256 JWT for DeviceCheck API authorization.