Skip to content

alasconnect/auth0

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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"'