newmana / auth0

Auth0 API in Haskell

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Auth0 API in Haskell

Implements the following APIs:

Note

This API is not fully tested due to the large number of Auth0 features. Please send a PR if you find that a particular endpoint doesn't behave as expected.

Usage

-- import relevant module
import Auth0.Authentication.GetToken

main :: IO ()
main = do
  -- example of fetching client credentials
  let bdy = GetTokenClientCreds ClientCredentials "client_id" "secret" "https://my-tenant.auth0.com/api/v2/"
  env <- mkAuth0Env "my-tenant.auth0.com"
  res <- runClientM (getTokenClientCreds bdy) env

Testing

export AUTH0_TENANT=<tenant>
export AUTH0_CLIENT_ID=<client_id>
export AUTH0_CLIENT_SECRET=<client_secret>
export AUTH0_AUDIENCE=<audience>
export AUTH0_CONNECTION=<connection>

nix-shell --run 'cabal new-test --enable-tests'

Developing

nix-shell --run 'ghcid --command="cabal new-repl auth0"'

About

Auth0 API in Haskell

License:Apache License 2.0


Languages

Language:Haskell 99.3%Language:Nix 0.7%