Skip to main content

Integrate with ChatGPT

Support level: Community

What is ChatGPT?

ChatGPT is OpenAI's conversational AI platform that provides chat-based assistance across the web and desktop applications.

-- https://chatgpt.com

Preparation

The following placeholders are used in this guide:

  • authentik.company is the FQDN of the authentik installation.
info

This documentation lists only the settings that you need to change from their default values. Be aware that any changes other than those explicitly mentioned in this guide could cause issues accessing your application.

ChatGPT supports SSO with either OIDC or SAML. Choose one protocol and follow the matching tab throughout this guide.

authentik configuration

To support the integration of ChatGPT with authentik, you need to create an application/provider pair in authentik.

Redirect URI changes in authentik 2026.5

In authentik versions earlier than 2026.5, all Redirect URIs are automatically treated as Authorization type. If you are using one of these older authentik versions, add only the Authorization URL to your Redirect URIs and do not configure a Post Logout URI.

Create an OIDC property mapping

ChatGPT expects a family_name claim in the OIDC profile data. Create a dedicated profile scope mapping so authentik sends the claim together with the standard profile values.

  1. Log in to authentik as an administrator and open the authentik Admin interface.
  2. Navigate to Customization > Property Mappings and click New Property Mapping.
  3. Select Scope Mapping and set the following values:
    • Mapping Name: enter a descriptive name, such as ChatGPT OIDC profile.
    • Scope name: profile
    • Expression:
ChatGPT OIDC profile scope mapping
name = request.user.name or request.user.username
name_parts = name.split(" ", 1)

given_name = request.user.attributes.get("given_name", name_parts[0])
family_name = request.user.attributes.get(
"family_name",
name_parts[1] if len(name_parts) > 1 else "",
)

return {
"name": name,
"given_name": given_name,
"family_name": family_name,
"preferred_username": request.user.username,
}
  1. Click Finish to save the property mapping.

Create an OIDC application and provider

  1. Log in to authentik as an administrator and open the authentik Admin interface.

  2. Navigate to Applications > Applications and click New Application to open the application wizard.

    • Application: provide a descriptive name, an optional group for the type of application, the policy engine mode, and optional UI settings. Take note of the Slug value because it will be required later.
    • Choose a Provider type: select OAuth2/OpenID Connect as the provider type.
    • Configure the Provider: provide a name (or accept the auto-provided name), the authorization flow to use for this provider, and the following required configurations.
      • Note the Client ID and Client Secret values because they will be required later.
      • Temporarily add a Redirect URI of type Strict Authorization as https://temp.temp.
      • Select any available Signing Key.
      • Under Advanced protocol settings, in Scopes, replace authentik default OAuth Mapping: OpenID 'profile' with the ChatGPT profile scope mapping that you created.
    • Configure Bindings (optional): you can create a binding (policy, group, or user) to manage the listing and access to applications on a user's Application Dashboard page.
  3. Click Submit to save the new application and provider.

ChatGPT configuration

Domain verification required

ChatGPT only enables SSO setup after you verify ownership of your domain. Domain verification and domain mapping are outside the scope of this guide. Refer to the OpenAI SSO configuration documentation for more details.

Configure ChatGPT with OIDC

  1. Log in to the OpenAI Identity page as a Global Admin.
  2. In the Single Sign-On section, click Set up SSO, then select Custom OIDC as the identity provider.
  3. Complete the Custom OIDC wizard:
    • Identity Provider Name: enter a descriptive name, such as authentik.
    • Create an Application: copy the Login redirect URI that ChatGPT displays.
    • Add Claims: confirm ChatGPT lists the required claims. The authentik provider created in the previous section sends sub, email, given_name, and family_name.
    • OIDC Configuration:
      • Client ID: enter the Client ID from authentik.
      • Client Secret: enter the Client Secret from authentik.
      • Discovery endpoint: https://authentik.company/application/o/<application_slug>/.well-known/openid-configuration
    • Application Link: review the direct sign-in link that ChatGPT generates; share it with users if needed.
    • Test Single Sign-On: run the built-in test. ChatGPT should redirect you to authentik for authentication and report success.

Update the OIDC provider in authentik

  1. Log in to authentik as an administrator and open the authentik Admin interface.
  2. Navigate to Applications > Providers and click the Edit icon of the newly created ChatGPT provider.
  3. Under Protocol settings, add a Redirect URI of type Strict Authorization as the Login redirect URI value from ChatGPT.
  4. Click Update.

Configuration verification

To verify that authentik is correctly integrated with ChatGPT, open ChatGPT, enter your email address, and click Continue. You should be redirected to authentik and, after a successful login, redirected back to ChatGPT.

Resources