OAuth2.AccessToken

Provides functionality to make authorized requests to an OAuth2 provider.

Source

Summary

expired?(token)

Determines if the access token has expired

expires?(accesstoken)

Determines if the access token expires or not

expires_at(val)

Returns a unix timestamp based on now + expires_at (in seconds)

get!(token, url, headers \\ [], opts \\ [])

Makes a GET request to the given URL using the AccessToken

get(token, url, headers \\ [], opts \\ [])

Makes a GET request to the given URL using the AccessToken

new(token, client)

Returns a new AccessToken struct

Types

access_token :: binary

refresh_token :: binary

expires_at :: integer

token_type :: binary

other_params :: %{}

t :: %OAuth2.AccessToken{access_token: access_token, refresh_token: refresh_token, expires_at: expires_at, token_type: token_type, other_params: other_params, client: OAuth2.Client.t}

Functions

expired?(token)

Determines if the access token has expired.

Source
expires?(accesstoken)

Determines if the access token expires or not.

Returns true unless expires_at is nil.

Source
expires_at(val)

Returns a unix timestamp based on now + expires_at (in seconds).

Source
get(token, url, headers \\ [], opts \\ [])

Makes a GET request to the given URL using the AccessToken.

Source
get!(token, url, headers \\ [], opts \\ [])

Makes a GET request to the given URL using the AccessToken.

An OAuth2.Error exception is raised if the request results in an error tuple ({:error, reason}).

Source
new(token, client)

Specs:

Returns a new AccessToken struct.

Source