SAML | Configure KeyCloak as IDP
Setting up KeyCloak
- Download KeyCloak from their official website (Used v25 here).
- Open conf/keycloak.conf and enter the hostname
- Run sh kc.sh start-dev
- Create a user and login at http://localhost:8080
Setting up the IDP:
- To enable logging, go to Realm Settings → Events → User Events Settings and turn them on.
- Download the metadata from SDP and go to Clients → Import client and drop this xml file.
- Turn off Client signature required and Import and then choose the NameID format and click Save.
- Go to Client scopes and remove the default role_list (as this gives multiple "role" attribute which causes error code 37)
- Choose the scope for your app ME_xxxx and click User Attribute Mapper For NameID while adding a new mapper.
- Configure the NameID format and the value cross checking the attribute name from Realm settings → User profile.
- For additional attributes, choose User Property, give display name, and the SAML Attribute Name (to be entered in SDP)
- Signing if required can be configured under the Keys section.
Setting up SDP
- In KeyCloak, Go to Realm Settings → Endpoints → SAML 2.0 Identity Provider Metadata and copy the URL from urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect to be entered in SDP as Login URL
- Copy the X509Certificate string and replace the middle part of a newly download .cer file from SDP and upload it to SDP.
- In SDP, Choose the Name ID format and algorithm as you saw in KeyCloak.
- For additional attributes, enter the SAML Attribute Name that you copied earlier.
- KeyCloak expects redirect binding, so run the following query and restart SDP:
update samlidp set binding='Redirect';
New to ADSelfService Plus?