View Source ExOauth2Provider.Plug (ExOauth2Provider v0.5.7)
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)
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
Functions
@spec authenticated?(Plug.Conn.t(), atom()) :: boolean()
Check if a request is authenticated
@spec 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
@spec current_resource_owner(Plug.Conn.t(), atom()) :: map() | nil
Fetch the currently authenticated resource if loaded, optionally located at a key