You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: examples/calling-apis/chatbot/README.md
+56Lines changed: 56 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,6 +25,62 @@ This is a [Next.js](https://nextjs.org) application that implements [Auth0 AI](h
25
25
- Note down the "Client ID" and "Client Secret" of this newly created Custom API Client.
26
26
- Either **Google**, **Slack** or **GitHub** social connections enabled for the application.
27
27
28
+
29
+
### Pre-requisite: Define a Multi-Resource Refresh Token policy for the Custom API Client
30
+
31
+
When a call to Token Vault fails due to the user not having a connected account (or lacking some permissions), this demo triggers a Connect Account flow for this user. This flow leverages Auth0 [My Account API](https://auth0.com/docs/manage-users/my-account-api), and as such, your application will need to have access to it in order to enable this flow.
32
+
33
+
In order to grant access from your Web Application to the My Account API, you will need to leverage the [Multi-Resource Refresh Token](https://auth0.com/docs/secure/tokens/refresh-tokens/multi-resource-refresh-token) feature, where the refresh tokens delivered to your SPA will also allow it to obtain an access token to call My Account API.
34
+
35
+
This will require defining a new [refresh token policy](https://auth0.com/docs/secure/tokens/refresh-tokens/multi-resource-refresh-token/configure-and-implement-multi-resource-refresh-token) for your client where the `audience` is `https://<your auth0 domain>/me/` and the `scope` should include at least the `"create:me:connected_accounts"` scope.
36
+
37
+
The configuration page explains how to achieve this using various tools, but here is an example showing how to do it with `curl`:
### Pre-requisite: Grant access to My Account API from your application
66
+
67
+
In order to grant access, use the [Application Access to APIs](https://auth0.com/docs/get-started/applications/application-access-to-apis-client-grants) feature, by creating a client grant for user flows.
Copy file name to clipboardExpand all lines: examples/calling-apis/spa-with-backend-api/react-hono-ai-sdk/README.md
+51-2Lines changed: 51 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -71,9 +71,58 @@ You will need the following prerequisites to run this app:
71
71
- In your Auth0 Dashboard, on the configuration page of your API, click the "Add Application" button in the header and create the Custom API Client
72
72
- Ensure that the `Token Vault` grant type is enabled under the Advanced Settings
73
73
- Note down the "Client ID" and "Client Secret" of this newly created Custom API Client
74
-
- This client enables Token Vault to exchange an access token for an external API access token (e.g., Google Calendar API)
74
+
- Now your Custom API will be able to use Token Vault, to exchange an access token for an external API access token (e.g., Google Calendar API)
75
+
76
+
4. Define a Multi-Resource Refresh Token policy for the Custom API Client
77
+
- When a call to Token Vault fails due to the user not having a connected account (or lacking some permissions), this demo triggers a Connect Account flow for this user. This flow leverages Auth0 [My Account API](https://auth0.com/docs/manage-users/my-account-api), and as such, your application will need to have access to it in order to enable this flow.
78
+
- In order to grant access from your SPA Application to the My Account API, you will need to leverage the [Multi-Resource Refresh Token](https://auth0.com/docs/secure/tokens/refresh-tokens/multi-resource-refresh-token) feature, where the refresh tokens delivered to your SPA will also allow it to obtain an access token to call My Account API.
79
+
- This will require defining a new [refresh token policy](https://auth0.com/docs/secure/tokens/refresh-tokens/multi-resource-refresh-token/configure-and-implement-multi-resource-refresh-token) for your SPA client where the `audience` is `https://<your auth0 domain>/me/` and the `scope` should include at least the `"create:me:connected_accounts"` scope.
80
+
- The configuration page explains how to achieve this using various tools, but here is an example showing how to do it with `curl`:
5. Grant access to My Account API from your application
109
+
- In order to grant access, use the [Application Access to APIs](https://auth0.com/docs/get-started/applications/application-access-to-apis-client-grants) feature, by creating a client grant for user flows.
0 commit comments