View Source API Reference BtrzAuth v1.3.0

Modules

BtrzAuth is the authentication api for the Betterez Elixir APIs.

This module should be used only by Phoenix Sockets.

This pipeline will

This pipeline will

Looks for the provider_ids in the query params and fetchs its premium keys using account data under conn.private.account saved by BtrzAuth.Plug.VerifyApiKey (the order of the plugs is very important!)

Looks for and validates a token found in the x-api-key header requesting the accounts service to verify the token and saving the resource in conn.private[:account].

Looks for and validates that the passed audiences are present in the private data under conn.private.user_aud saved by BtrzAuth.Plug.VerifyToken (the order of the plugs is very important!)

Looks for and validates that the passed keys features are present in the account data under conn.private.account["premium"] saved by BtrzAuth.Plug.VerifyApiKey (the order of the plugs is very important!)

Looks for and validates if there are provider_ids in the query params and if they are valids with the account data under conn.private.account saved by BtrzAuth.Plug.VerifyApiKey (the order of the plugs is very important!)

It depends on BtrzAuth.Plug.VerifyApiKey, looks for a token in the Authorization header and verify it using first the account's private key, if not valid, then main and secondary secrets provided by your app for internal token cases.

InternalTokenToken will generate tokens for internal services authentication

UserToken will generate tokens for users authentication