AuthManager.Accounts.Guardian (auth_manager v0.1.0)
Implementación de Guardian para la autenticación basada en JWT.
Summary
Functions
Callback implementation for Guardian.after_encode_and_sign/4
.
Callback implementation for Guardian.after_sign_in/5
.
Callback implementation for Guardian.before_sign_out/3
.
Callback implementation for Guardian.build_claims/3
.
Fetches the configuration for this module.
Returns a resolved value of the configuration found at a key.
Función para crear tokens de acceso para un usuario.
Función para crear tokens de refresco para un usuario.
Decodes and verifies a token using the configuration on the implementation module.
The default type of token for this module.
Encodes the claims.
Exchanges a token of one type for another.
Función para intercambiar un token de refresco por un nuevo token de acceso.
Función para verificar y obtener el usuario a partir de un token.
Callback implementation for Guardian.on_exchange/3
.
Callback implementation for Guardian.on_refresh/3
.
Callback implementation for Guardian.on_revoke/3
.
Callback implementation for Guardian.on_verify/3
.
Provides the content of the token but without verification of either the claims or the signature.
Refresh a token.
Función utilizada para cargar el recurso a partir del subject.
Fetch the resource and claims directly from a token.
Revoke a token.
If Guardian.Plug.SlidingCookie is used, this callback will be invoked to return the new claims, or an error (which will mean the cookie will not be refreshed).
Función utilizada para extraer el identificador del recurso de un subject.
Callback implementation for Guardian.verify_claims/2
.
Functions
Callback implementation for Guardian.after_encode_and_sign/4
.
Callback implementation for Guardian.after_sign_in/5
.
Callback implementation for Guardian.before_sign_out/3
.
Callback implementation for Guardian.build_claims/3
.
@spec config() :: Keyword.t()
Fetches the configuration for this module.
Returns a resolved value of the configuration found at a key.
Función para crear tokens de acceso para un usuario.
Función para crear tokens de refresco para un usuario.
@spec decode_and_verify( Guardian.Token.token(), Guardian.Token.claims(), Guardian.options() ) :: {:ok, Guardian.Token.claims()} | {:error, any()}
Decodes and verifies a token using the configuration on the implementation module.
@spec default_token_type() :: String.t()
The default type of token for this module.
@spec encode_and_sign(any(), Guardian.Token.claims(), Guardian.options()) :: {:ok, Guardian.Token.token(), Guardian.Token.claims()} | {:error, any()}
Encodes the claims.
See Guardian.encode_and_sign/4
for more information.
@spec exchange( token :: Guardian.Token.token(), from_type :: String.t() | [String.t(), ...], to_type :: String.t(), options :: Guardian.options() ) :: {:ok, {Guardian.Token.token(), Guardian.Token.claims()}, {Guardian.Token.token(), Guardian.Token.claims()}} | {:error, any()}
Exchanges a token of one type for another.
See Guardian.exchange
for more information.
Función para intercambiar un token de refresco por un nuevo token de acceso.
Función para verificar y obtener el usuario a partir de un token.
Callback implementation for Guardian.on_exchange/3
.
Callback implementation for Guardian.on_refresh/3
.
Callback implementation for Guardian.on_revoke/3
.
Callback implementation for Guardian.on_verify/3
.
Provides the content of the token but without verification of either the claims or the signature.
Claims will be present at the :claims
key.
See Guardian.peek/2
for more information.
@spec refresh(Guardian.Token.token(), Guardian.options()) :: {:ok, {Guardian.Token.token(), Guardian.Token.claims()}, {Guardian.Token.token(), Guardian.Token.claims()}} | {:error, any()}
Refresh a token.
See Guardian.refresh
for more information.
Función utilizada para cargar el recurso a partir del subject.
@spec resource_from_token( token :: Guardian.Token.token(), claims_to_check :: Guardian.Token.claims() | nil, opts :: Guardian.options() ) :: {:ok, Guardian.Token.resource(), Guardian.Token.claims()} | {:error, any()}
Fetch the resource and claims directly from a token.
See Guardian.resource_from_token
for more information.
@spec revoke(Guardian.Token.token(), Guardian.options()) :: {:ok, Guardian.Token.claims()} | {:error, any()}
Revoke a token.
See Guardian.revoke
for more information.
@spec sliding_cookie( current_claims :: Guardian.Token.claims(), current_resource :: Guardian.Token.resource(), options :: Guardian.options() ) :: {:ok, new_claims :: Guardian.Token.claims()} | {:error, any()}
If Guardian.Plug.SlidingCookie is used, this callback will be invoked to return the new claims, or an error (which will mean the cookie will not be refreshed).
Función utilizada para extraer el identificador del recurso de un subject.
Callback implementation for Guardian.verify_claims/2
.