CPub.Web.Authorization.Utils (CPub v0.3.0) View Source

Helpers and utils for dealing with OAuth 2.0 Endpoint requests.

Link to this section Summary

Functions

Returns the CPub.Web.Authorization.Client associated with the connection.

Returns a valid redirect_uri for given connection and client/authorization.

Returns a valid scope for given connection and client

Returns OAuth 2.0 request state from connection

Link to this section Functions

Specs

get_client(Plug.Conn.t()) ::
  {:ok, CPub.Web.Authorization.Client.t()} | {:error, any(), any()}

Returns the CPub.Web.Authorization.Client associated with the connection.

Link to this function

get_client_credentials(conn)

View Source

Specs

get_client_credentials(Plug.Conn.t()) :: {String.t(), String.t()}
Link to this function

get_redirect_uri(conn, client)

View Source

Specs

get_redirect_uri(Plug.Conn.t(), CPub.Web.Authorization.Client.t()) ::
  {:ok, URI.t()} | {:error, any(), any()}

Returns a valid redirect_uri for given connection and client/authorization.

Specs

get_scope(Plug.Conn.t(), CPub.Web.Authorization.Client.t()) ::
  {:ok, [atom()]} | {:error, any(), any()}

Returns a valid scope for given connection and client

Specs

get_state(Plug.Conn.t()) :: {:ok, String.t()}

Returns OAuth 2.0 request state from connection