Connect to Enterprise SSO button. Clicking it sends the user to Keycloak with
the kc_idp_hint=enterprise_sso parameter, which tells Keycloak to skip its own
login page and redirect straight to the identity provider whose alias is
enterprise_sso. After the user authenticates, Keycloak brokers them back and
OpenHands creates the session.
SAML single sign-on is an OpenHands Enterprise feature. See
Enterprise vs Open Source.
Prerequisites
- An OpenHands Enterprise installation using Helm or Replicated.
- Administrator access to your corporate identity provider to create a SAML application and read its metadata.
- Administrator access to the bundled Keycloak. Keycloak is served on your
installation’s Authentication hostname (
auth.<your-openhands-domain>by default). For Helm installations, the admin password is the value you placed in thekeycloak-adminKubernetes secret during installation. - The Keycloak realm for the installation is
allhands. All URLs below assume this realm.
Step 1: Enable the Environment Variable
The OpenHands login page shows theConnect to Enterprise SSO button only when
the ENABLE_ENTERPRISE_SSO environment variable is present in the OpenHands
application server environment. The value itself is not parsed. Any non-empty
value enables the button.
For Helm installations, add the variable to the top-level env map in your
values.yaml:
https://app.<your-openhands-domain> now shows the
Connect to Enterprise SSO button.
Step 2: Register Keycloak as a SAML Service Provider with Your Identity Provider
Keycloak acts as a SAML service provider (SP) towards your corporate identity provider. Create a SAML application in your identity provider with these values:
Replace
<your-auth-hostname> with your installation’s Authentication hostname
(auth.<your-openhands-domain> by default), for example
https://auth.openhands.example.com/realms/allhands/broker/enterprise_sso/endpoint.
Send these attribute statements with the SAML response:
email(required)firstNameandlastName(recommended)
On VM (Replicated embedded cluster) installations, you can skip Steps 3-4:
in the Admin Console under Enterprise SSO (SAML) Authentication, enable
the option and provide your identity provider’s SAML Metadata URL. The
installer then creates and keeps updated the
enterprise_sso SAML identity
provider in the bundled Keycloak automatically — including the mapper from
Step 4. Leave the metadata URL blank to do Steps 3-4 manually instead.Step 3: Create the SAML Identity Provider in Keycloak
- Open the Keycloak Admin Console on your Authentication hostname and sign in with the Keycloak admin credentials.
-
Select the
allhandsrealm. - Go to Identity providers and choose SAML v2.0 as the new provider type.
-
Set Alias to exactly
enterprise_sso. -
Set a Display name, for example
Company SSO. - Import the identity provider metadata from Step 2. Provide the metadata URL or upload the file, depending on what your identity provider offers. Keycloak fills in the identity provider’s single sign-on URL and signing certificates from the metadata.
-
Recommended settings:
- Enable Validate signatures so Keycloak verifies SAML responses against the imported certificates.
- Select Trust email so users are not prompted to verify their email address on first sign-in.
- Save the provider.
Step 4: Add the Required Identity Provider Mapper
OpenHands distinguishes SAML logins from OAuth logins by reading aidentity_provider claim on the signed-in user. Add a mapper on the new
provider so that claim carries the SAML marker:
- Open the
enterprise_ssoidentity provider and go to its Mappers tab. - Create a mapper with type Hardcoded attribute.
- Set the user attribute to
identity_provider. - Set the value to
enterprise_sso:saml.
saml suffix tells the OpenHands backend to skip the OAuth broker-token
lookup and offline-token validation that do not apply to SAML identity
providers.
If your identity provider does not send the attributes as
email,
firstName, and lastName, add SAML attribute importers on the same
Mappers tab to map your identity provider’s attribute names onto the
OpenHands user profile.Step 5: Verify Sign-In
- Open
https://app.<your-openhands-domain>in a private browser window. - Click
Connect to Enterprise SSO. - Complete sign-in on your corporate identity provider.
- Confirm you return to OpenHands signed in.
SAML single sign-on only establishes the OpenHands session. Users who work
with repositories still need to connect their Git provider from Settings >
Integrations inside OpenHands.

