API Reference Guardian v2.3.1



Guardian provides a singular interface for authentication in Elixir applications that is token based.

Working with configuration for guardian.

An optional plugin to Guardian to provide permissions for your tokens.

Atom encoding for permissions.

Bitwise encoding for permissions.

Behavior for the permission encoding.

Text encoding for permissions.

Provides functions for the implementation module for dealing with Guardian in a Plug environment.

This plug ensures that a valid token was provided and has been verified on the request.

This plug ensures that a resource is not logged in.

Optional Behaviour for creating error handlers for Guardian.Plug.Pipeline.

Calculates keys for use with plug.

This plug loads the resource associated with a previously validated token. Tokens are found and validated using the Verify* plugs.

Helps to build plug pipelines for use with Guardian and associated plugs.

WARNING! Use of this plug MAY allow a session to be maintained indefinitely without primary authentication by issuing new refresh tokens off the back of previous (still valid) tokens. Especially if your resource_from_claims implementation does not check resource validity (in a user database or whatever), you SHOULD then at least make such checks in the sliding_cookie/3 implementation to make sure the resource still exists, is valid and permitted.

Looks for and validates a token found in the request cookies.

Looks for and validates a token found in the Authorization header.

Looks for and validates a token found in the session.

The behaviour module for all token modules.

Deals with things JWT. This module should not be used directly.

Provides a behaviour that specifies how to fetch the secret for the token.

Verifies standard jwt fields

Interface for verifying tokens.


Mix Tasks

Generates a secret and prints it to the terminal.