Skip to main content
Use Auth0 SDKs to fetch access tokens for social and enterprise identity providers from Auth0’s Token Vault. Using these access tokens, AI agents integrated with the application can call third-party APIs to perform tasks on the user’s behalf. By the end of this quickstart, you should have an AI application integrated with Auth0 that can:
  1. Retrieve access tokens for a Google social connection.
  2. Integrate with an AI agent to call Google APIs.

Pick your tech stack

  • https://mintlify-assets.b-cdn.net/auth0/langchain.svg LangGraph.js + Next.js
  • https://mintlify-assets.b-cdn.net/auth0/vercel.svg Vercel AI + Next.js
  • https://mintlify-assets.b-cdn.net/auth0/langchain.svg LangGraph + FastAPI
  • https://mintlify-assets.b-cdn.net/auth0/vercel.svg Vercel AI + React SPA

Prerequisites

Before getting started, make sure you have completed the following steps:
1

Create an Auth0 Account

To continue with this quickstart, you need to have an Auth0 account.
2

Create an Auth0 Application

Go to your Auth0 Dashboard to create a new Auth0 Application.
  • Navigate to Applications > Applications in the left sidebar.
  • Click the Create Application button in the top right.
  • In the pop-up select Regular Web Applications and click Create.
  • Once the Application is created, switch to the Settings tab.
  • Scroll down to the Application URIs section.
  • Set Allowed Callback URLs as: http://localhost:3000/auth/callback
  • Set Allowed Logout URLs as: http://localhost:3000
  • Click Save in the bottom right to save your changes.
To learn more about Auth0 applications, read Applications.
3

Enable Token Vault Grant

Enable the Token Vault Grant for your Auth0 Application. Go to Applications > [Your Application] > Settings > Advanced > Grant Types and enable the Token Vault grant type.
4

Create an Auth0 API

  • In your Auth0 Dashboard, go to Applications > APIs.
  • Create a new API with an identifier (audience).
  • Once API is created, go to the APIs Settings > Access Settings and enable Allow Offline Access.
  • Note down the API identifier for your environment variables.
To learn more about Auth0 APIs, read APIs.
5

Create a Custom API Client

The Custom API Client allows your API server to perform token exchanges using access tokens instead of refresh tokens. This client enables Token Vault to exchange an access token for an external API access token (e.g., Google Calendar API).
  • Navigate to Applications > APIs
  • Click the Create API button to create a new Custom API.
  • Go to the Custom API you created and click the Add Application button in the right top corner.
  • After that click the Configure Application button in the right top corner.
  • Note down the client id and client secret for your environment variables.
6

Configure Google Social Integration

Set up a Google developer account that allows for third-party API calls by following the Google Social Integration instructions.
7

OpenAI Platform

Next steps

You have successfully added the ability to get access tokens for tool calling to your application. For next steps:
I