The single public-facing authentication type for the Discogs API.
Use the factory functions to create an Authorization and pass it as the
first argument to any function that requires authentication.
Personal Token
token = ExDisco.Config.user_token()
auth = ExDisco.Auth.Authorization.for_user_token(token)
auth
|> ExDisco.Users.get_identity()OAuth
{:ok, credentials} = ExDisco.Auth.access_token(request_token, verifier)
credentials
|> ExDisco.Users.get_identity()
Summary
Functions
Creates an Authorization from OAuth credentials.
Creates an Authorization from a personal token string.
Types
@type t() :: %ExDisco.Auth.Authorization{ credentials: term(), type: :user_token | :oauth }
Functions
Creates an Authorization from OAuth credentials.
Examples
iex> ExDisco.Auth.Authorization.for_oauth("key", "secret", "token", "token_secret")
%ExDisco.Auth.Authorization{type: :oauth, credentials: %{...}}
Creates an Authorization from a personal token string.
Examples
iex> ExDisco.Auth.Authorization.for_user_token("my_token")
%ExDisco.Auth.Authorization{type: :user_token, credentials: "my_token"}