<!-- llms.txt: https://workos.com/llms.txt -->
<!-- feedback.md: https://workos.com/docs/feedback.md -->

# ChatGPT OAuth

## Introduction

The ChatGPT OAuth integration allows your users to authenticate using their ChatGPT credentials.

The configuration process involves creating an OAuth application in the OpenAI Platform and configuring the client credentials in your WorkOS Dashboard.

> Sign in with ChatGPT is currently available to a select group of partners approved by OpenAI.

***

## What WorkOS provides

When setting up ChatGPT OAuth, WorkOS provides one key piece of information that needs to be configured in your OpenAI OAuth application:

- [Redirect URI](https://workos.com/docs/glossary/redirect-uri): The endpoint where OpenAI will send authentication responses after successful login

The Redirect URI is available in the [WorkOS Dashboard](https://dashboard.workos.com/). In the left navigation menu, select the **Authentication** tab and the **Providers** sub-tab. Locate the **ChatGPT** section.

![The ChatGPT OAuth section in the WorkOS Dashboard.](https://images.workoscdn.com/images/217e5c8c-5fbb-4f78-95f3-22f1d329eb6f.png?auto=format\&fit=clip\&q=50)

Click **Enable**. The **ChatGPT OAuth** configuration dialog will open. Locate the **Redirect URI**.

![The ChatGPT OAuth configuration modal in the WorkOS Dashboard.](https://images.workoscdn.com/images/44950022-0f08-4c99-894e-cb9745c7a041.png?auto=format\&fit=clip\&q=50)

The **Redirect URI** serves as the destination for authentication responses and must be configured in your OpenAI OAuth application.

***

## What you'll need

You will need to obtain the following from an OpenAI OAuth application:

- **ChatGPT Client ID**: Application identifier from OpenAI, typically beginning with `oaiapp_`
- **ChatGPT Client Secret**: Authentication secret for the application

The following sections will guide you through creating an OAuth application in the OpenAI Platform.

***

## (1) Create an OpenAI OAuth application

Log in to the [OpenAI Platform](https://platform.openai.com) and select **OAuth apps** in the left navigation menu, then click **Register app**.

![The OAuth apps page in the OpenAI Platform.](https://images.workoscdn.com/images/6490d86f-df7b-4954-b7c5-c4b97785e80e.png?auto=format\&fit=clip\&q=50)

***

## (2) Configure the OAuth application

Fill out the form with relevant details about your application. In the **OAuth client** step, enter the **Redirect URI** from the ChatGPT OAuth configuration in the WorkOS Dashboard.

Set **Client type** to **Confidential** and **Client authentication method** to `client_secret_basic`.

![The Client authentication method set to client\_secret\_basic in the OpenAI Platform.](https://images.workoscdn.com/images/25e11203-c682-42e6-a6e1-16f8c637e349.png?auto=format\&fit=clip\&q=50)

***

## (3) Retrieve client credentials

When you save the OAuth application, OpenAI shows the **Client Secret**. Copy it before you close the dialog.

![The Client Secret shown after saving the OAuth application in the OpenAI Platform.](https://images.workoscdn.com/images/b9998b80-6b0a-4d9c-b8e9-3031ca67eb0e.png?auto=format\&fit=clip\&q=50)

> **Important**: OpenAI only shows the Client Secret once. Make sure to copy and store it securely.

After you close the dialog, the application's summary page shows the **Client ID** in the **OAuth client** section. Copy it as well.

![The Client ID in the OAuth client section of the OpenAI Platform.](https://images.workoscdn.com/images/dc04a1e9-45bf-49a5-9f16-105f74ec5f5a.png?auto=format\&fit=clip\&q=50)

***

## (4) Configure ChatGPT credentials in WorkOS

Now that you have the **ChatGPT Client ID** and the **ChatGPT Client Secret**, return to the [WorkOS Dashboard](https://dashboard.workos.com).

In the **ChatGPT OAuth** configuration dialog, enable the integration. Paste the credentials from OpenAI into their respective fields in the WorkOS Dashboard.

![Where to enter ChatGPT client credentials in the WorkOS Dashboard.](https://images.workoscdn.com/images/e002811f-fcbf-4d0f-b10d-caf97489f426.png?auto=format\&fit=clip\&q=50)

Click **Save changes** to complete the configuration.

You are now ready to start authenticating with ChatGPT OAuth. If you are using AuthKit's [Hosted UI](https://workos.com/docs/authkit/hosted-ui), a Continue with ChatGPT button will be added to your login page.

If you are building your own authentication flows outside of AuthKit's hosted UI, you will use the `provider` query parameter in the [Get Authorization URL API endpoint](https://workos.com/docs/reference/authkit/authentication/get-authorization-url) to support global ChatGPT OAuth for any domain. The `provider` query parameter should be set to `ChatGPTOAuth`.

***

## Frequently asked questions

### How is the WorkOS ChatGPT OAuth integration different from implementing Sign in with ChatGPT myself?

It's the same OpenID Connect flow as you could build yourself, but it's encapsulated within WorkOS SSO. This means you don't need to build it yourself. In addition to ChatGPT OAuth, you can use WorkOS SSO to support other identity providers, all with a single integration.

### What is the provider query parameter and how is it used in the ChatGPT OAuth integration?

If you are building your own authentication flows outside of AuthKit's hosted UI, you can use the `provider` query parameter in the [Get Authorization URL API endpoint](https://workos.com/docs/reference/authkit/authentication/get-authorization-url) to support global ChatGPT OAuth for any domain. The `provider` query parameter should be set to `ChatGPTOAuth`.

### What scopes are required for ChatGPT OAuth?

The **openid**, **profile**, and **email** scopes are required to allow the application to read user profile information necessary for authentication. These scopes provide access to the user's basic profile data and email address.
