ExOauth2Provider v0.5.5 ExOauth2Provider.Plug View Source

ExOauth2Provider.Plug contains functions that assist with interacting with ExOauth2Provider via Plugs.

ExOauth2Provider.Plug is not itself a plug.

Use the helpers to look up current_access_token and current_resource_owner.

Example

ExOauth2Provider.Plug.current_access_token(conn)
ExOauth2Provider.Plug.current_resource_owner(conn)

Link to this section Summary

Functions

Check if a request is authenticated

Fetch the currently verified token from the request. Optionally located at a key

Fetch the currently authenticated resource if loaded, optionally located at a key

Link to this section Functions

Link to this function

authenticated?(conn, type \\ :default)

View Source
authenticated?(Plug.Conn.t(), atom()) :: boolean()

Check if a request is authenticated

Link to this function

current_access_token(conn, the_key \\ :default)

View Source
current_access_token(Plug.Conn.t(), atom()) ::
  ExOauth2Provider.AccessTokens.AccessToken.t() | nil

Fetch the currently verified token from the request. Optionally located at a key

Link to this function

current_resource_owner(conn, the_key \\ :default)

View Source
current_resource_owner(Plug.Conn.t(), atom()) :: map() | nil

Fetch the currently authenticated resource if loaded, optionally located at a key