Ueberauth.Strategy.EVESSO.OAuth (Ueberauth EVE Online v1.0.4)

View Source

An implementation of OAuth2 for EVE SSO

To add your client_id and client_secret include these values in your configuration.

config :ueberauth, Ueberauth.Strategy.EVESSO.OAuth,
  client_id: System.get_env("EVESSO_CLIENT_ID"),
  client_secret: System.get_env("EVESSO_SECRET_KEY")

Summary

Functions

OAuth2 strategy callback to generate the authorization URL.

Provides the authorize url for the request phase of Ueberauth. No need to call this directly usually.

Construct a client for requests to EVE SSO

Fetch a URL using the access token for authentication.

OAuth2 strategy callback to get the access token from EVE SSO.

Request an access token from EVE SSO.

Decodes the JWT locally and retrieves the user information held within.

Functions

authorize_url(client, params)

@spec authorize_url(
  OAuth2.Client.t(),
  keyword()
) :: OAuth2.Client.t()

OAuth2 strategy callback to generate the authorization URL.

This is called automatically by the OAuth2 client.

authorize_url!(params \\ [], opts \\ [])

@spec authorize_url!(keyword(), keyword()) :: String.t()

Provides the authorize url for the request phase of Ueberauth. No need to call this directly usually.

client(opts \\ [])

@spec client(keyword()) :: OAuth2.Client.t()

Construct a client for requests to EVE SSO

Optionally include any OAuth2 options here to be merged with the defaults.

Ueberauth.Strategy.EVESSO.OAuth.client(redired_uri: "http://localhost:4000/auth/evesso/callback")

This will be set up automatically for you in Ueberauth.Strategy.EVESSO. These options are only useful for usage outside the normal callback phase of Ueberauth.

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

Fetch a URL using the access token for authentication.

Most users of this library should not need to call this directly.

get_token(client, params, headers)

@spec get_token(OAuth2.Client.t(), keyword(), keyword()) :: OAuth2.Client.t()

OAuth2 strategy callback to get the access token from EVE SSO.

This handles the EVE SSO requirement that client credentials should not be duplicated in both the Authorization header and request body.

get_token!(params \\ [], options \\ [])

@spec get_token!(keyword(), keyword()) :: OAuth2.AccessToken.t()

Request an access token from EVE SSO.

This is called automatically by the Ueberauth flow.

verify(token)

@spec verify(OAuth2.AccessToken.t()) :: {:ok, map()} | {:error, String.t()}

Decodes the JWT locally and retrieves the user information held within.

More work could be done here to actually validate the token, see ESI docs for details