API Reference ash_authentication v4.3.5
Modules
AshAuthentication provides a turn-key authentication solution for folks using Ash.
Confirmation support.
Actions for the confirmation add-on.
Performs a change based on the contents of a confirmation token.
Triggers a confirmation flow when one of the monitored fields is changed.
Defines the Spark DSL entity for this add on.
Handlers for incoming OAuth2 HTTP requests.
DSL transformer for confirmation add-on.
DSL verifier for confirmation add-on.
Provides the default implementation of AshAuthentication.HashProvider
using Bcrypt
.
This check is true if the context private.ash_authentication?
is set to true.
Allows you to debug authentication failures in development.
A generic, authentication failed error.
An unconfirmed user cannot be confirmed outside of explicit actions.
An invalid token was presented.
A secret is now missing.
Given a successful registration or sign-in, generate a token.
A behaviour providing password hashing.
Codemods for working with AshAuthentication
Generated configuration functions based on a resource's DSL configuration.
Uses the excellent joken
hex package to generate and sign Json Web Tokens.
Implementation details JWT generation and validation.
Generate an authentication plug.
Provides the default implementations of handle_success/3
and
handle_failure/2
used in generated authentication plugs.
Route requests and callbacks to the correct provider plugs.
Authentication helpers for use in your router, etc.
Generators used within use AshAuthentication.Plug
.
Dynamically generates the authentication router for the authentication requests and callbacks.
Filters a user by the identifier in the subject of a JWT.
A module to implement retrieving of secrets.
Implements AshAuthentication.Secret
for functions that are provided to the
DSL instead of modules.
A module to implement sending of a token to a user.
Implements AshAuthentication.Sender
for functions that are provided to the
DSL instead of modules.
The protocol used for interacting with authentication strategies.
Strategy for authenticating using Apple Sign In
DSL verifier for Apple strategy.
Strategy for authenticating using Auth0.
Define your own custom authentication strategy.
Helpers for use within custom strategies.
Transformer used by custom strategies.
Verifier used by custom strategies.
Strategy for authenticating using GitHub
Strategy for authenticating using Google
Strategy for authentication using a magic link.
Actions for the magic link strategy.
Plugs for the magic link strategy.
Requests a magic link for the given identity field.
Prepare a query for a magic link request.
Set up a create action for magic link sign in.
Prepare a query for sign in.
DSL transformer for magic links.
DSL verifier for magic links.
Strategy for authenticating using any OAuth 2.0 server as the source of truth.
Actions for the oauth2 strategy.
Defines the Spark DSL entity for this strategy.
Updates the identity resource when a user is registered.
Handlers for incoming OAuth2 HTTP requests.
Prepare a query for sign in
DSL transformer for oauth2 strategies.
DSL verifier for oauth2 strategies.
Strategy for authentication using an OpenID Connect compatible server as the source of truth.
An implmentation of AshAuthentication.Secret
that generates nonces for
OpenID Connect strategies.
DSL transformer for oidc strategies.
DSL verifier for OpenID Connect strategy.
Strategy for authenticating using local resources as the source of truth.
Actions for the password strategy
Defines the Spark DSL entity for this strategy.
Set the hash based on the password input.
Validate that the password and password confirmation match.
A convenience validation that checks that the password argument against the hashed password stored in the record.
Plugs for the password strategy.
Requests a password reset.
Prepare a query for a password reset request.
Validate that the token is a valid password reset request token.
The entity used to store password reset information.
Prepare a query for sign in
Prepare a query for sign in via token.
DSL transformer for the password strategy.
DSL verifier for the password strategy.
Strategy for authenticating using Slack
DSL verifier for Slack strategy.
Starts and manages any processes required by AshAuthentication.
This is an Ash resource extension which generates the default token resource.
The code interface for interacting with the token resource.
A GenServer
which periodically removes expired token revocations.
Constrains a query to only records which are confirmations that match the jti argument.
Constrains a query to only records which match the jti
or token
argument
and optionally by the purpose
argument.
Introspection functions for the AshAuthentication.TokenResource
Ash
extension.
Checks for the existence of a revocation token for the provided tokenrevocation token for the provided token.
Constrains a query to only records which are revocations that match the token or jti argument.
Generates a revocation record for a given token.
Populates the JTI based on the token argument.
Stores an arbitrary token.
The token resource transformer.
The token resource verifier.
The Authentication transformer
Sets the select_for_senders
options to its default value.
An Ash extension which generates the default user identities resource.
Code interface for provider identity actions.
Introspection functions for the AshAuthentication.UserIdentity
Ash
extension.
The user identity transformer.
A change which upserts a user's identity into the user identity resource.
The user identity verifier.
Common validations shared by several transformers.
Validation helpers for Resource actions.
Validation helpers for Resource attributes.
The Authentication verifier.
Mix Tasks
Adds the provided strategy or strategies to your user resource
Installs AshAuthentication. Invoke with mix igniter.install ash_authentication