Skip to content

Latest commit

 

History

History
20 lines (15 loc) · 712 Bytes

PROVIDER_AUTH0.md

File metadata and controls

20 lines (15 loc) · 712 Bytes

Auth0 example

Create an Auth0 account and an api as well as a native app.

Run web server

TOKEN_ISSUER="https://<domain>.auth0.com/"
TOKEN_AUDIENCE="https://localhost:8081"
CLIENT_ID="Auth0NativeAppClientID"
go run ./api/main.go --server [server] --provider auth0 --token-issuer ${TOKEN_ISSUER} --token-audience ${TOKEN_AUDIENCE} --required-auth0-client-id ${CLIENT_ID} --port 8081

Test with curl

ACCESS_TOKEN=$(go run ./pkce-cli/main.go --issuer ${TOKEN_ISSUER} --client-id ${CLIENT_ID} --extra-authz-params audience:${TOKEN_AUDIENCE} | jq -r ".access_token")
curl -s http://localhost:8081 | jq
curl -s -H "Authorization: Bearer ${ACCESS_TOKEN}" http://localhost:8081 | jq