---
title: Configure single sign-on
description: Connect an OpenID Connect provider and map directory groups to Glodrik access.
---

You need a system administrator account in Glodrik and an administrator who can create a client in your identity provider. Keep a working local system administrator account for recovery.

## Register the client

In your provider, create a confidential OpenID Connect client. Enable the authorization code flow with PKCE S256 and retain its client ID and secret. Register this exact redirect URI using your actual Glodrik URL, including any port:

```text
https://glodrik.example.com:8443/api/oidc/callback
```

For Keycloak, use **Clients → Create client**, enable **Client authentication** and **Standard flow**, and use the realm issuer, for example `https://id.example.com/realms/automation`. If you want group mapping, add a group membership mapper to send the `groups` claim in the ID token or UserInfo.

## Configure Glodrik

1. Under **Settings**, set the public URL to the browser-facing address.
2. Under **Single sign-on**, enter the issuer, client ID, secret, and button name. Configure the provider's CA if it uses private certificates.
3. If you use provider groups, set the groups claim name. Under **Organization → Groups**, map the provider group names under **Directory groups** and give each Glodrik group the required access.
4. Save, then verify in a separate browser session that a test user can sign in and has the expected permissions.

The SSO admin groups setting grants system-wide access. Keep it restricted to provider groups intended to administer the entire instance. Directory membership updates at sign-in.

If sign-in fails, compare the redirect URI character for character, verify the issuer and client secret, and inspect **Audit log** for failed sign-ins. For group mapping, check the exact claim value including any full group path. For environment-managed deployments, see the [API settings reference](https://github.com/glodrik-forge/glodrik/tree/main/api).
