PowAssent v0.1.0 PowAssent.Plug View Source
Plug helper methods.
If you wish to configure PowAssent through the Pow plug interface rather than
environment config, please add PowAssent config with :pow_assent
config:
plug Pow.Plug.Session,
repo: MyApp.Repo,
user: MyApp.User,
pow_assent: [
http_adapter: PowAssent.HTTPAdapter.Mint,
json_library: Poison,
user_identities_context: MyApp.UserIdentities
]
Link to this section Summary
Functions
Calls the authentication method for the strategy provider
Lists available strategy providers for connection
Calls the callback method for the strategy provider
Create a user with user identity
Deletes the associated user identity for the current user and strategy
Lists associated strategy providers for the user
Link to this section Functions
authenticate(Plug.Conn.t(), binary(), binary()) :: {:ok, binary(), Plug.Conn.t()} | {:error.any(), Plug.Conn.t()}
Calls the authentication method for the strategy provider.
A generated redirection URL will be returned.
available_providers(Plug.Conn.t() | PowAssent.Config.t()) :: [atom()]
Lists available strategy providers for connection.
callback(Plug.Conn.t(), binary(), map()) :: {:ok, map(), Plug.Conn.t()} | {:error, {:bound_to_different_user | :invalid_user_id_field, map()}, Plug.Conn.t()} | {:error, {:strategy, any()}, Plug.Conn.t()} | {:error, map(), Plug.Conn.t()}
Calls the callback method for the strategy provider.
A user will be created if a user doesn’t already exists in connection or for the associated user identity. If a matching user identity association doesn’t exist for the current user, a new user identity is created. Otherwise user is authenticated.
create_user(Plug.Conn.t(), binary(), map(), map()) :: {:ok, map(), Plug.Conn.t()} | {:error, map(), Plug.Conn.t()}
Create a user with user identity.
delete_identity(Plug.Conn.t(), binary()) :: {:ok, map(), Plug.Conn.t()} | {:error, any(), Plug.Conn.t()}
Deletes the associated user identity for the current user and strategy.
providers_for_current_user(Plug.Conn.t()) :: [atom()]
Lists associated strategy providers for the user.