Auth0Ex

Hex versionHex downloadsBuild Status

An elixir client library for Auth0

Installation

You can install the stable version from hex:

def deps do
[{:auth0_ex, "~> 0.9"}]
end

You can use github repo as your package source to use the latest source code but beware it might have breaking and unstable code:

def deps do
  [{:auth0_ex, github: "techgaun/auth0_ex"}]
end

Configuration

Add a configuration block like below:

You can create non-interactive client for management api as described HERE. Once you do that, you should be able to grab client ID and client secret from the setting page for use with Auth0Ex. This is a recommended setup as Auth0Ex can recreate new access_token when the current one expires.

config :auth0_ex,
  domain: System.get_env("AUTH0_DOMAIN"),
  mgmt_client_id: System.get_env("AUTH0_MGMT_CLIENT_ID"),
  mgmt_client_secret: System.get_env("AUTH0_MGMT_CLIENT_SECRET"),
  http_opts: []
config :auth0_ex,
  domain: System.get_env("AUTH0_DOMAIN"),
  mgmt_token: System.get_env("AUTH0_MGMT_TOKEN"),
  http_opts: []

Notes

Export appropriate environment variable and you should be all set.

Please refer to the documentation for more details.

Authentication API

In addition to the management API resources, there is also a support for most used authentication APIs. Authentication API will use the same domain config you specify in the config above. If you wish to use Auth0Ex for authentication APIs only, all you need to specify is domain in config.

Author