Integrating ReportPortal with Keycloak: A Step-by-Step Guide
Configure single sign-on for ReportPortal using Keycloak as the SAML identity provider. This guide covers creating the Keycloak SAML client and enabling the integration on the ReportPortal side.
It is also possible to install ReportPortal using the cluster add-ons. For details, please refer to the Install via Add-Ons page.
Prerequisites
- Keycloak is installed. For detailed instructions, please refer to the provided documentation.
- ReportPortal is installed. To install it using the Helm Chart, please follow the instructions outlined in the corresponding documentation.
Keycloak Configuration
The Keycloak configuration can also be applied using Keycloak resources from the Cluster Add-Ons repository. To apply the Keycloak configuration, the Keycloak Operator is required. For installation details, refer to the Install Keycloak Operator page.
-
Navigate to Client Scopes > Create client scope and create a new scope with the SAML protocol type.
-
Navigate to Client Scopes > your_scope_name > Mappers > Configure a new mapper > select the User Attribute mapper type. Add three mappers for the email, first name, and last name by typing
lastName,firstName, andemailin the User Attribute field:- Name is a display name in Keycloak.
- User Attribute is a user property for mapping.
- SAML Attribute Name is an attribute used for requesting information in the ReportPortal configuration.
- SAML Attribute NameFormat:
Basic. - Aggregate attribute values:
Off.

-
Navigate to Clients > Create client and fill in the following fields:
- Client type:
SAML. - Client ID:
report.portal.sp.id.
warningThe
report.portal.sp.idClient ID is a constant value. - Client type:
-
Navigate to Client > your_client > Settings and add
https://<report-portal-url>/*to the Valid redirect URIs. -
Navigate to Client > your_client > Keys and disable Client signature required.

-
Navigate to Client > your_client > Client scopes and add the scope created on step 3 with the default Assigned type.

ReportPortal Configuration
-
Log in to the ReportPortal with the admin permissions.
-
Navigate to Client > Administrate > Plugins and select the SAML plugin.

-
To add a new integration, fill in the following fields:

- Provider name is the display name in the ReportPortal login page.
- Metadata URL
https://<keycloak_url>/auth/realms/<realm>/protocol/saml/descriptor. - Email is the value from the SAML Attribute Name field in the Keycloak mapper.
- RP callback URL
https://<report_portal_url>/uat. - Name attributes mode is the first & last name (type based on your mapper).
- First name is the value from the SAML Attribute Name field in the Keycloak mapper.
- Last name is the value from the SAML Attribute Name field in the Keycloak mapper.
-
Log in to the ReportPortal.
noteBy default, after the first login, ReportPortal creates the
<your_email>_personalproject and adds an account with theProject managerrole.
Sign SAML Requests (ReportPortal 26.0.x)
Keycloak requires service providers to sign SAML authentication requests (WantAuthnRequestsSigned="true" in its SAML metadata). By default, ReportPortal 26.0.x does not sign them, so Login with SAML fails and the uat pod logs the following error:
IllegalArgumentException: Failed to resolve any signing credential
To enable SAML request signing, provide the uat service with a keystore that contains a signing key, and set the signing parameters.
This procedure applies to ReportPortal 26.0.x, where authentication runs in the separate uat deployment. The values below have no effect on versions that do not include that deployment.
-
Generate a JKS keystore with the
report-portal-spkey alias:keytool -genkeypair -alias report-portal-sp -keyalg RSA -keysize 2048 -validity 3650 \-dname "CN=report.portal.sp.id" -keystore keystore.jks -storetype JKS \-storepass '<keystore-password>' -keypass '<keystore-password>'warningThe keystore must use the
JKStype, as ReportPortal loads it in that format. Use a strong random password, and do not commit the keystore or the password to Git. -
Create a Secret with the keystore and both passwords:
kubectl -n <report-portal-namespace> create secret generic reportportal-saml-keystore \--from-file=keystore.jks=keystore.jks \--from-literal=keystore-password='<keystore-password>' \--from-literal=key-password='<keystore-password>'When using the External Secrets Operator, store the keystore Base64-encoded in the secret store and decode it with
decodingStrategy: Base64. -
Add the following to the ReportPortal Helm values:
reportportal:uat:extraEnvs:- name: RP_AUTH_SAML_SIGNED-REQUESTSvalue: "true"- name: RP_AUTH_SAML_KEY-STOREvalue: "file:///etc/saml/keystore.jks"- name: RP_AUTH_SAML_KEY-ALIASvalue: "report-portal-sp"- name: RP_AUTH_SAML_KEY-STORE-PASSWORDvalueFrom:secretKeyRef:name: reportportal-saml-keystorekey: keystore-password- name: RP_AUTH_SAML_KEY-PASSWORDvalueFrom:secretKeyRef:name: reportportal-saml-keystorekey: key-passwordextraVolumes:- name: saml-keystoresecret:secretName: reportportal-saml-keystoreitems:- key: keystore.jkspath: keystore.jksextraVolumeMounts:- name: saml-keystoremountPath: /etc/samlreadOnly: true -
Wait for the
uatpod to restart, and then check its log. The following messages must not appear:Skipping SAML providerNo valid SAML providers registered -
Log in with SAML as a user that already exists in ReportPortal. ReportPortal matches the user by email, signs in to the existing account, and does not create a duplicate account.