Ueberauth.Strategy.Apple.Token (Ueberauth Apple Strategy v0.7.0)

Copy Markdown View Source

Provides helpers for working with Apple-generated tokens.

Apple provides a public list of keys that may be used for token signing at https://appleid.apple.com/auth/keys. Additional documentation about the Identity Token issued by Apple can be found here.

Summary

Types

Public Key used by Apple to sign ID Tokens

t()

ID Token supplied by the Apple Auth API

Functions

Decode an ID Token provided by the Apple Auth API.

Types

public_key()

@type public_key() :: map()

Public Key used by Apple to sign ID Tokens

t()

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

ID Token supplied by the Apple Auth API

Functions

payload(id_token, opts \\ [])

@spec payload(
  t(),
  keyword()
) :: {:ok, map()} | {:error, term()}

Decode an ID Token provided by the Apple Auth API.

Options

  • :client_id: The expected audience of the token. This is required.

  • :issuer: The expected issuer of the token. Defaults to "https://appleid.apple.com".

  • :public_keys: {Module, :function, args} to call in order to get a list of public keys. The returned data must be in the form {:ok, keys} where keys is a list of maps matching the structure found at https://appleid.apple.com/auth/keys. Defaults to a function that uses HTTPoison to request the keys on every call.