Discovergy v0.3.0 Discovergy.OAuth View Source

The OAuth endpoint

Normally it is not necessary to call the individual authentication steps manually, see Discovergy.Client.login/3.

Link to this section Summary

Functions

Registers the client application, obtains and authorizes a request token and finally obtains an access token.

Link to this section Functions

Link to this function

authorize(client, request_token, email, password)

View Source

Specs

authorize(
  Discovergy.Client.t(),
  Discovergy.OAuth.Token.t(),
  String.t(),
  String.t()
) :: {:ok, Discovergy.OAuth.Grant.t()} | {:error, Discovergy.Error.t()}

Authorization step 3

See the OAuth 1.0 specification for details.

Link to this function

get_access_token(client, consumer, request_token, grant)

View Source

Specs

get_access_token(
  Discovergy.Client.t(),
  Discovergy.OAuth.Consumer.t(),
  Discovergy.OAuth.Token.t(),
  Discovergy.OAuth.Grant.t()
) :: {:ok, Discovergy.OAuth.Token.t()} | {:error, Discovergy.Error.t()}

Authorization step 4

See the OAuth 1.0 specification for details.

Link to this function

get_request_token(client, consumer)

View Source

Specs

Authorization step 2

See the OAuth 1.0 specification for details.

Link to this function

login(client, email, password)

View Source

Specs

login(Discovergy.Client.t(), String.t(), String.t()) ::
  {:ok, {Consumer.t(), Token.t()}} | {:error, Discovergy.Error.t()}

Registers the client application, obtains and authorizes a request token and finally obtains an access token.

Link to this function

register_consumer(client, client_id)

View Source

Specs

register_consumer(Discovergy.Client.t(), String.t()) ::
  {:ok, Discovergy.OAuth.Consumer.t()} | {:error, Discovergy.Error.t()}

Authorization step 1

See the OAuth 1.0 specification for details.