> ## Documentation Index
> Fetch the complete documentation index at: https://docs.openhands.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Configure Auth Providers

> Add and manage login providers and Git provider integrations in OpenHands Enterprise with Auth V2.

Use the `Auth Providers` page of the [Super Admin dashboard](https://docs.openhands.dev/enterprise/super-admin.md) to add the identity providers
and Git providers that your users sign in with or connect to OpenHands Enterprise.

## Prerequisites

* Auth V2 is enabled. See [Migrate From V1 to V2](https://docs.openhands.dev/enterprise/auth-v2/migrate-from-v1.md).
* You are a Super Admin.
* Your license includes SSO, if you are adding a SAML or direct OIDC login provider such as Okta or Google.
* Administrator access to the provider you are connecting, so you can create an OAuth app or a SAML application.

## Add a Provider

1. Open the Super Admin dashboard and choose `Auth Providers`.
2. Select `Add Provider`.
3. Choose a preset in `Provider Type`, then select `Create Provider`.
   The provider is created with placeholder values and switched off, so you can copy its URLs into your provider first.
4. On the provider's edit page, copy the `Redirect URL` (OAuth) or the `SP Metadata URL` (SAML) into the
   OAuth app or SAML application you create in your provider.
5. Enter the details from your provider. See [Provider Details](#provider-details).
6. Turn on `Enabled`, then select `Save Changes`.

Providers you add here connect directly to the provider, not through Keycloak. Use this for new integrations. The
`Log in with` providers migrated from V1 keep using Keycloak until you replace them.

Open OpenHands in a private browser window to check the result. The login screen shows a button for each enabled login
provider. When only one login provider is enabled, users go straight to it.

## Provider Details

> [tab] Okta
>
> Choose the `Okta OIDC` preset. In your Okta OIDC app, add the `Redirect URL` as an allowed redirect URI.
>
> In the `Authorization URL`, `Token URL`, and `Userinfo URL` fields, replace `YOUR_DOMAIN` with your Okta domain.
> Then enter the app's `Client ID` and `Client Secret`.
>
> The preset requests the scopes `openid`, `email`, and `offline_access`.

> [tab] Google
>
> Choose the `Google OIDC` preset. The endpoints and the scopes `openid` and `email` are already filled in. Enter the
> `Client ID` and `Client Secret` of your Google OAuth client, and add the `Redirect URL` to its allowed redirect URIs.

> [tab] Generic OIDC
>
> Choose the `Generic OAuth / OIDC` preset for any other OAuth 2.0 or OIDC provider.
>
> Replace the `PLACEHOLDER.COM` values in `Authorization URL`, `Token URL`, and `Userinfo URL` with your provider's
> endpoints. Then enter the `Client ID` and `Client Secret`.
>
> The preset requests the scopes `openid`, `email`, and `offline_access`.

> [tab] Git Provider
>
> Choose the preset for your Git provider: `GitHub`, `GitLab`, `Bitbucket`, `Bitbucket Data Center`, or
> `Azure DevOps`. The endpoints and scopes are already filled in.
>
> 1. Create an OAuth app in your Git provider. The edit page links to the provider's settings where you create it.
>    Add the `Redirect URL` as the app's callback URL.
> 2. Enter the app's `Client ID` and `Client Secret`.
> 3. For a self-hosted provider, replace the host in the endpoint URLs. For `Bitbucket Data Center`, replace
>    `YOUR_BITBUCKET_HOST`. For `Azure DevOps`, replace `YOUR_TENANT_ID` with your Microsoft Entra tenant ID.
> 4. Choose how users use the provider with `Use as OpenHands Authentication Provider`. When it is on, the provider
>    is also a sign-in option. When it is off, users only connect it from `Settings > Integrations`.
>
> New Git providers start with `Use as OpenHands Authentication Provider` on. See
> [Login and Integrations](https://docs.openhands.dev/enterprise/auth-v2/overview.md#login-and-integrations).

> [tab] Jira Data Center
>
> Choose the `Jira Data Center` preset. It is available in OpenHands Enterprise 0.108.0 and later.
>
> 1. In Jira Data Center, create an incoming OAuth application link as described in
>    [Create a Jira OAuth Application](https://docs.openhands.dev/enterprise/integrations/jira-data-center.md#create-a-jira-oauth-application),
>    and add the `Redirect URL` as a callback URL.
> 2. In the `Authorization URL`, `Token URL`, and `Userinfo URL` fields, replace `YOUR_DOMAIN` with your Jira Data
>    Center host.
> 3. Enter the application's `Client ID` and `Client Secret`.
>
> The preset requests the scope `WRITE` and sets `Attribute Mapping` to `sub=key, email=emailAddress`. The
> `Sandbox secret name` is `JIRA_DC_TOKEN`.
>
> Jira Data Center is not a Git provider, so it doesn't appear in `Settings > Integrations`. Users get its token by
> signing in with it. See
> [Use Jira Data Center Sign-In With the Integration](#use-jira-data-center-sign-in-with-the-integration).

> [tab] SAML
>
> Choose the `Generic SAML` preset.
>
> 1. If `SP Certificate` says it is generated when you save, select `Save Changes` and open the provider again.
> 2. In your identity provider, create a SAML application. Give it the `SP Metadata URL`, or download the
>    certificate with `Download Cert as PEM` if your provider asks for it separately.
> 3. Enter your identity provider's metadata in `IDP Metadata URL`. The fields below it fill in when you leave the
>    field. If your provider has no metadata URL, enter `IdP Entity ID`, `SSO URL`, `SSO Binding`,
>    `Single Logout URL`, and `IdP x509 Certificate` yourself.
> 4. Set `Name ID Format`. The preset uses an email address.
> 5. Check `Attribute Mapping`. The preset maps `email` to the `email` attribute. If your identity provider sends the
>    email in another attribute, change the mapping, for example to `email=mail`. A sign-in with no email is rejected.
>    In releases up to 0.112.0, the preset has no mapping and OpenHands uses the email `Name ID` as the user's email.
>
> The [SAML SSO](https://docs.openhands.dev/enterprise/integrations/saml-sso.md) guide describes the V1 setup.

> [tab] Integrated Password
>
> Choose `Integrated Password` to let users sign in to OpenHands with an email and password. You can add one
> integrated password provider.
>
> To limit which accounts can use it, enter patterns in `Permitted Email Patterns`, for example
> `e2e-*@example.com`. Use `*` as a wildcard. Leave the field empty to allow any email.

## Provider Settings

These settings are on the provider's edit page.

| Setting | Description |
| - | - |
| `Type` | `OAuth`, `Integrated Password`, or `SAML`. |
| `Title` | The name of the provider. |
| `Button Color` | The color of the provider's login button. |
| `Icon (SVG)` | Raw SVG markup for the login button. Leave it blank to use a generic icon. |
| `Enabled` | Allows users to sign in or connect through this provider. |
| `Accept new registrations` | When off, only people who already have an account linked to this provider can sign in. A first-time identity is refused instead of creating a user. |
| `Link existing accounts by email` | When on, someone who signs in through this provider for the first time is linked to the existing account with the same email. Turn it on only for providers you trust to assert email addresses their users own. |
| `Use as OpenHands Authentication Provider` | OAuth providers only. Shows the provider as a sign-in button on the login screen. |
| `Provider` | OAuth providers only. The provider brand. Use `Enterprise SSO` for Okta, Google, and other identity providers, and `Jira Data Center` for Jira Data Center. |
| `Client ID` and `Client Secret` | OAuth providers only. Leave `Client Secret` blank to keep the current secret. Changing any field below it requires re-entering the secret. |
| `Authorization URL`, `Token URL`, `Userinfo URL`, `Scopes` | OAuth providers only. Enter scopes separated by spaces or commas. |
| `Sandbox secret name` | OAuth providers only. The name under which a linked user's access token for this provider is available in their conversations, for example `GITHUB_TOKEN`. Leave it empty to keep the token out of conversations. |
| `Attribute Mapping` | Maps `sub`, `email`, and `email_verified` to the claim or attribute your provider sends. Use it for providers that don't return standard OIDC claims. |
| `Keycloak-federated git provider` | Set on providers created when you [migrate from V1](https://docs.openhands.dev/enterprise/auth-v2/migrate-from-v1.md). |

## Manage Providers

The `Auth Providers` list shows each provider's `Type`, an `Enabled` switch, and a `Login IDP` switch. Use the row menu to
edit a provider, view its user links, or delete it.

* **Disable a provider**: Turn off `Enabled`. Users can no longer start a new sign-in or connection through it. Users who
  are already signed in or connected keep working.
* **View user links**: Choose `User Links` to see the accounts linked to a provider. You can re-point an external identity
  to a different account.
* **Delete a provider**: Choose `Delete` and confirm. This cannot be undone.

## Make Your Identity Provider the Only Way In

With Auth V2, having a GitHub, GitLab, or other Git provider account doesn't give someone access to OpenHands. Only the
providers you enable for sign-in do. To make your own identity provider (IdP), using OIDC or SAML, the single source of
truth:

1. Add and enable your IdP. Turn on `Link existing accounts by email` on it, so existing users keep their accounts.
   Turn this on only if your IdP asserts email addresses its users own. Open OpenHands in a private browser window and
   check that you can sign in with it.
2. Turn off `Enabled` on every other sign-in provider, such as the `Log in with GitHub`, `Log in with GitLab`, and
   `Log in with Bitbucket` providers that the migration created. Also turn it off on `Login with Password` if you don't
   want email and password sign-in.
3. For the Git providers you keep as integrations, turn off `Use as OpenHands Authentication Provider` and
   `Accept new registrations`. Users then connect them from `Settings > Integrations` after they sign in with your
   IdP, and a Git account alone can't create a user.

Users who are already signed in keep working until their session ends.

## Use Jira Data Center Sign-In With the Integration

A `Jira Data Center` provider works with the [Jira Data Center integration](https://docs.openhands.dev/enterprise/integrations/jira-data-center.md)
when both of these are true:

* The host in the provider's `Token URL` is the same host as the integration's `Jira Data Center Base URL`.
* The user signed in with the provider.

For those users:

* **Connecting**: When the user connects Jira Data Center in `Settings > Integrations`, OpenHands links their Jira
  account without a second Jira consent screen. This applies when the integration's user linking method is OAuth.
* **Jira events**: OpenHands matches the Jira user who triggers an event to the OpenHands user through their Jira
  user key, without a separate connection step. A user who disconnected Jira Data Center in `Settings > Integrations`
  stays disconnected.
* **Conversations**: The user's Jira access token is available in their conversations under the provider's
  `Sandbox secret name`, and the agent is told the Jira base URL and the secret name.

## Connect Git Providers as a User

Users connect Git providers from `Settings > Integrations`. The page lists the enabled Git providers. A disabled provider
appears only for users who already connected it, so they can disconnect it.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.