SSO using Keycloak

Installing and Configuring SSO Using Keycloak on Platform9 Managed Kubernetes

In this article, we discuss the implementation of SSO using Keycloak on PMK. PMK can be configured to use any SAML2 provider, including KeyCloak as a specific implementation of the SAML2 IdP.

What is Keycloak?

Keycloak is an open-source Identity and Access Management (IAM) solution committed to improving secure access to applications and services. Keycloak authenticates users across a unified environment rather than single applications. Once the user is logged in to Keycloak, it delegates the authenticated validation to all affiliated applications. Keycloak also affords a single-sign-out service that specifies that once users log out of Keycloak, their access is revoked across all applications. Keycloak also authenticates individuals using active OpenID Connect or SAML 2.0 Identity Providers. The document describes how to set up keycloak as an IdP for the platform9 on-premise management plane.

Prerequisites

  • Keycloak REALM with a SAML 2.0 Endpoint.

Configuration

Settings within Keycloak

First, log in to the Keycloak UI and choose your realm to create the Platform9 service provider. In this example, we will use a realm named Master. Next, save the SAML 2.0 Identity Provider Metadata in an XML file by clicking on the SAML 2.0 link in the Endpoints section of the Realm Settings. Throughout this document, this XML file will be referenced as metadata.xml. Now, click Realm Settings and choose “SAML 2.0 identity Provider Metadata’ in the Endpoints section. Finally, download the page employing an XML format and save it as metadata.xml.

The following .xml file include a blank line after the comment section. Users can delete this blank line from the metadata.xml file permissions.

metadata.xml
Copy

Now, in the UI, create a platform9 SAML 2.0 client by clicking on ‘Clients’ followed by clicking on 'Create'

Type the on-premises DU’s keystone URL, e.g. ‘https://airctl-4.pf9.localnet/keystone’, then select SAML from the Client Protocol dropdown and click Save.

Next, edit the client settings: Click Clients ⇾ https://airctl-4.pf9.localnet/keystone ⇾ Settings and add the following information to the configurations.

Replace the DU name with the name of your own DU (management plane)

Bash
Copy

Screenshots of the Client Settings:

Add mappers

In this section, we create mappers using the FirstName, LastName, Email, and memberOf attributes of the keycloak user.

Finally, create the mappers for the Email and LastName attributes similarly. In the end, the final mappers view will look like below:

Appendix A

User properties in keycloak

Appendix B

Reference: export of the client.

Bash
Copy
Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard
  Last updated