dnsimple v1.2.0 Dnsimple.Oauth

Provides functions to authenticate through the OAuth web application flow.

See:

Summary

Functions

Returns the URL to start the OAuth dance

Returns the access token for a given authorization code

Functions

authorize_url(client, client_id, query \\ [])

Specs

Returns the URL to start the OAuth dance.

See:

Examples:

client = %Dnsimple.Client{access_token: "a1b2c3d4"}
url = Dnsimple.Oauth.authorize_url(client, client_id = "1z2y3x", state: "12345678")
exchange_authorization_for_token(client, attributes, options \\ [])

Specs

exchange_authorization_for_token(Dnsimple.Client.t, map, keyword) :: {:ok | :error, String.t}

Returns the access token for a given authorization code.

See:

Examples:

client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Oauth.exchange_authorization_for_token(client, %{
  code: "authorization_code",
  state: "12345678",
  client_id: "1z2y3x",
  client_secret: "xXxXxX",
})