This is a sample app to interact with Daffy public API. The public API it's in BETA so all methods are subject to change.
Check the BETA documentation here: https://daffy-docs.notion.site/Public-API-6f76f6a682984dd99daca5f7fe892d07
- Update your .env file
Enter your
CLIENT_ID
,CLIENT_SECRET
andISSUER_HOST
. - start the node server by running
node index.js
. - visit
localhost:8080
and sign in.
The way partners make API requests to Daffy is via JWTs via OpenID. In order to obtain a JWT on behalf of a user, the flow goes like this:
- User goes to your site and you prompt them to Sign in with Daffy.
- User is taken to Auth0 where they authenticate, neither Daffy or the partner access login credentials.
- When Auth0 completes the sign in process the user is taken to the redirect URL for the partner, which is configurable inside
.env
withBASE_URL
. - The previous callback will send a JWT that the partner stores via session or at a DB and it's used to talk to the Daffy public API. See
routes/index.js axios.post
method. - Subsequent API calls to Daffy need to send two parameters inside the
Authorization
header. Like this:
Authorization: client_id jwt_token
For an example see the routes/index.js axios.post
method.