Follow the steps below to configure Artifactory with Keycloak as a SAML SSO authentication provider.
In Keycloak, Enter the Administration Console
Select your realm from the drop-down menu or click Create Realm to create a new one
Go to Clients > Create client to Create a new client
Change the client type to SAML and select the custom base URL of the Artifactory instance (for example “https://yourcompanyname.jfrog.io “). Then, click Save to save the changes.
After creating the client, you will be directed to the client settings page. Ensure that Sign Assertions is enabled while Force POST Binding and Front Channel Logout are disabled.
In Valid Redirect URIs, enter your JFrog host URL followed by a wildcard (for example “
https://artifactory.jfrog.io/*
” or “http://IP:PORT/*”). In Root URL and Home URL, enter this URL:<CUSTOM_URL>/ui/api/v1/auth/saml/loginResponse/<SAML_DISPLAY_NAME>
Note
Make sure to replace the placeholders in <angle brackets> with your own custom URL and SAML display name.
Navigate to Clients > Keys and switch the Client Signature Required toggle to Off.
Navigate to the Advanced tab, scroll down to Fine Grain SAML Endpoint Configuration and in both Logout Service POST Binding URL and Logout Service Redirect Binding URL as your JFrog host URL followed by “
/ui/login
” (For example: “https://artifactory.jfrog.io/ui/login
”).Click Save to save the changes made to the client settings.
Navigate to Realm Settings > Keys, and copy the RSA Generated certificate.
On the JFrog Platform: Login to the JFrog Platform, navigate to the Administration > Authentication Provider and then select SAML SSO.
Select the Enable SAML Integration checkbox, and click +Add SAML SSO Configuration. There, enter the following values:
In SAML Login URL, enter
<KEYCLOAK_URL>/realms/<REALM>/protocol/saml
In SAML Login URL, enter
<KEYCLOAK_URL>/realms/<REALM>/protocol/saml
In SAML Service Provider Name, enter
<KEYCLOAK_URL>/realms/<REALM>
In SAML Certificate, enter the certificate you copied from Keycloak in step 10.
Note
Make sure to replace the placeholders in <angle brackets> with your own Keycloak URL and realm. For example:
https://KeyCloackURL/realms/master/protocol/saml
Click Save to create the configuration.
To configure the Keycloak integration with JFrog, you will need to configure a group mapper, an attribute that is used to associate the realm groups with Artifactory. To configure a basic group mapper
In Keycloak: Navigate to Client scopes and click role_list (make sure the scope protocol is SAML)
In the Client scope details menu, go to the Mappers tab and click Add Mapper > By Configuration, and select Group list from the table.
Next, enter any name for the mapper, and the group attribute name. This attribute name will be used to associate the realm groups in Artifactory.
Switch the Full group path toggle to Off and click Save.
In the JFrog Platform: Navigate to the SAML SSO configuration page (Administration > Authentication > SAML SSO) and edit your SAML configuration.
Select the Auto Associate Groups checkbox
In Group Attribute, enter the value you entered for Group Attribute Name in Keycloak in step 3.
Click Save.