Chapter 5. Configuring SSSD to use a generic identity provider
In Red Hat Enterprise Linux (RHEL), the System Security Services Daemon (SSSD) supports a direct integration with modern identity providers (IdP) that use the OAuth 2.0 and OpenID Connect (OIDC) protocols. This currently allows you to authenticate users against Red Hat build of Keycloak or Microsoft Entra ID without requiring a traditional LDAP or Active Directory infrastructure.
The generic identity provider is a Technology Preview feature only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs) and might not be functionally complete. Red Hat does not recommend using them in production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.
For more information about the support scope of Red Hat Technology Preview features, see Technology Preview Features Support Scope.
5.1. Prerequisites Copy linkLink copied to clipboard!
-
The
sssd-idppackage is installed on the RHEL system. For more details, see thesssd-idpman page. - You have administrator access to your identity provider (Keycloak or Entra ID).
- The RHEL system can reach the IdP’s discovery and token endpoints over HTTPS.
5.2. How SSSD authenticates with a generic IdP Copy linkLink copied to clipboard!
SSSD (System Security Services Daemon) uses the OAuth 2.0 Device Authorization Grant flow to handle authentication with a generic IdP where a web browser cannot be directory rendered, such as RHEL terminal sessions.
- SSSD generates a user-friendly URL and a unique device code.
- The user opens the URL on a separate device (such as a smartphone or laptop).
- The user enters the code to authorize the RHEL login session, and, if the user is not already logged in, authenticates with the IdP.
- SSSD automatically detects the authorization and grants access to the RHEL session.
If the URL is provided by the server-side, SSSD might show a single URL where the code is already included in the URL, for example, https://master.keycloak.test:8443/auth/realms/device?user_code=NVCT-RUFA instead of URL https://master.keycloak.test:8443/auth/realms/device and the NVCT-RUFA code provided separately.
5.3. Registering an SSSD client in Red Hat build of Keycloak Copy linkLink copied to clipboard!
Before configuring SSSD, you must register the SSSD client in Keycloak. This client manages the user authentication via the Device Authorization Grant and performs user and group lookups on behalf of SSSD.
Prerequisites
- Red Hat build of Keycloak is installed and configured.
- You have administrator access to the Red Hat build of Keycloak Admin Console.
- The system has a valid SSL/TLS certificate if using HTTPS for the IdP.
Procedure
-
Log in to the Keycloak Admin Console and select your
Realm. - Navigate to Clients > Create client and select OpenID Connect as the Client type.
- Specify a Client ID, for example, RHELSSSDClient and click Next.
- Specify a name for the client, for example RHELSSSDClient.
Click Next and ensure the following settings are enabled for the SSSD client:
- Client authentication is on.
- Under Authentication flow, ensure the OAuth 2.0 Device Authorization Grant and Service accounts roles are both enabled.
- Click Next and click Save.
- On your SSSD client page, click Service account roles to add the required roles to your client.
Click Assign Roles and select the following roles from the list:
- View-groups
- Query-groups
- Query-users
- View-users
- Click Assign.
- Click Clients > RHELSSSDClient.
- Select the Credentials tab.
Click the copy icon beside the Client Secret to save it to your clipboard.
Use this Client Secret to configure SSSD for generic IdP authentication.
5.4. Registering an SSSD client in Microsoft Entra ID Copy linkLink copied to clipboard!
Before configuring SSSD, you must register the SSSD client in your IdP. This client in Microsoft Entra ID handles the user authentication via the Device Authorization Grant and also performs the necessary user and group lookups on behalf of SSSD. Registering your application in Microsoft Entra establishes a trust relationship between your app and the Microsoft identity platform.
Prerequisites
- Your Microsoft Entra ID tenant is configured and you have administrator access.
- The system has a valid SSL/TLS certificate if using HTTPS for the IdP.
Procedure
- Sign in to the Microsoft Entra admin center.
- Go to Identity > Applications > App registrations > New registration.
- Enter a meaningful name for your application, for example RHELSSSDClient, and select the supported account types.
Under Authentication, choose one of the following:
- If you are using the device code flow without a secret, ensure Allow public client flows is set to Yes.
- If you are configuring a confidential client, navigate to Certificates & secrets and create a Client secret.
- Copy the Application (client) ID and Directory (tenant) ID.
Grant the registered application specific Application Permissions (not Delegated) to allow SSSD to retrieve user and group metadata via Client Credentials. Configure these under Manage > API permissions in the Azure Portal:
-
Group.Read.All -
GroupMember.Read.All -
User.Read.All(enables SSSD to look up other users during the identity phase) -
User.Read Admin Consent: All
Applicationlevel permissions require a status ofGranted for [Organization]to take effect.NoteYou must grant Admin Consent for
User.Read. Without it, user authentication might fail if the SSSD optionidp_auth_scopeexcludes theuser.readscope.
-
5.5. Configuring SSSD for generic IdP authentication Copy linkLink copied to clipboard!
Configure the System Security Services Daemon (SSSD) to authenticate users directly against modern identity providers. By modifying /etc/sssd/sssd.conf, you enable secure communication between RHEL and your chosen OIDC-compliant provider, currently either Red Hat build by Keycloak or Microsoft Entra ID.
Prerequisites
-
The
sssd-idppackage is installed.
Procedure
-
To enable the generic IdP provider, open
/etc/sssd/sssd.confin a text editor. Define the domain configuration for either Red Hat Build of Keycloak or Microsoft Entra ID using the
id_provider=idpoption.To define the configuration for Red Hat Build of Keycloak, add the following to the
sssd.conffile:[sssd] services = nss, pam domains = keycloak [domain/keycloak] idp_type = keycloak:https://master.keycloak.test:8443/auth/admin/realms/master/ id_provider = idp auto_private_groups = true use_fully_qualified_names = true idp_client_id = <RHELSSSDClient> idp_client_secret = <RHELSSSDClientPassword> idp_token_endpoint = https://master.keycloak.test:8443/auth/realms/master/protocol/openid-connect/token idp_userinfo_endpoint = https://master.keycloak.test:8443/auth/realms/master/protocol/openid-connect/userinfo idp_device_auth_endpoint = https://master.keycloak.test:8443/auth/realms/master/protocol/openid-connect/auth/device idp_id_scope = profile idp_auth_scope = openid profile email [nss] default_shell = /bin/bash fallback_homedir = /home/%fTo define the configuration for Microsoft Entra ID, add the following to the
sssd.conffile:[sssd] services = nss, pam domains = entra_id [domain/entra_id] id_provider = idp auto_private_groups = true use_fully_qualified_names = true idp_client_id = <UUID_of_your_Entra_ID_client> idp_client_id = <Password_of_your_Entra_ID_client> idp_token_endpoint = https://login.microsoftonline.com/<your_Entra_ID_tennant_UUID>/oauth2/v2.0/token idp_device_auth_endpoint = https://login.microsoftonline.com/<your_Entra_ID_tennant_UUID>/oauth2/v2.0/devicecode idp_userinfo_endpoint = https://graph.microsoft.com/v1.0/me idp_id_scope = https%3A%2F%2Fgraph.microsoft.com%2F.default idp_auth_scope = openid profile email [nss] default_shell = /bin/bash fallback_homedir = /home/%f
Remove any remaining logs and clear the cache:
# sssctl logs-remove# sssctl cache-remove -opsRestart SSSD:
# systemctl restart sssd
Verification
Attempt to look up a user defined in your IdP:
# getent password <user_name>@keycloak<user_name>@keycloak:*:955808455:955808455::/home/<user_name>@keycloak:/bin/bashAttempt to log in as a user defined in your IdP:
# ssh -l <user_name>@keycloak localhost(<user_name>@keycloak@localhost) Authenticate at https://master.keycloak.test:8443/auth/realms/device?user_code=NVCT-RUFACopy the URL to your web browser.
NoteEnsure that you are not logged into the Keycloak Admin Console as another user or this attempt to log in fails.
- Enter your username and password to sign in. Note that the first time you log in, you have to change to a new password.
- On the Grant Access to YourKeycloakSSSDClient window, select Yes.
- Return to the SSSD configuration window and press ENTER.
You should be logged in. Verify you are logged in as <user_name>:
[<user_name>@keycloak@client ~] $ iduid=955808455(<user_name>@keycloak) gid=955808455(<user_name>@keycloak) groups=955808455(<user_name>@keycloak),955844066(group2@keycloak),955943585(group1@keycloak)