WorkOS Docs Homepage
Integrations

ChatGPT OAuth

Learn how to set up Sign in with ChatGPT

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.

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

  • Redirect URI: The endpoint where OpenAI will send authentication responses after successful login

The Redirect URI is available in the WorkOS Dashboard. 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.

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

The ChatGPT OAuth configuration modal in the WorkOS Dashboard.

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

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.

Log in to the OpenAI Platform and select OAuth apps in the left navigation menu, then click Register app.

The OAuth apps page in the OpenAI Platform.

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.

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.

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.

Now that you have the ChatGPT Client ID and the ChatGPT Client Secret, return to the WorkOS Dashboard.

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.

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, 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 to support global ChatGPT OAuth for any domain. The provider query parameter should be set to ChatGPTOAuth.

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 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.