I just configured a Keycloak 20.0.5 to use Identity Brokering with an Okta SAML App via an SAML IdP in Keycloak with success.
I can now login in with Okta to applications secured by Keycloak.
I created the Okta SAML app first and then configured the Okta SAML IdP in Keycloak.
So keep in mind to use the same realm name (acme-apps in my example) and IdP alias in Keycloak later (okta-saml in my example).
Audience Restriction:
https://id.acme.test:8443/auth/realms/acme-apps (This is the realm entityID of the "Keycloak SP")
Name ID Format: EmailAddress
"Attribute Statements (optional)"
Optionally configure mappings for firstname and lastname, e.g.:
- givenName Basic user.firstName
- surname Basic user.lastName
"Sign-On":
In the "Sign-on tab Click" "View SAML Setup instructions", then scoll down to "IDP metadata to your SP provider."
Copy the xml metadata snippet and store it as a file with an URL reachable by Keycloak.
"Assignments":
Select indivial users or groups who should be allowed to login to Keycloak via Okta.
2. Create a new SAML IdP in Keycloak
Identity Provider -> SAML v2.0
Display Name: Okta
Alias: okta-saml
Service provider entity ID: Base URL of your realm, e.g.:
https://id.acme.test:8443/auth/realms/acme-apps (This is used by the audience restriction above)
Use entity descriptor: "on"
SAML entity descriptor: Enter the URL to the xml metadata snippet (or set Use entity descriptor: "off") and enter metadata from the xml file by hand.
Click Mappers, then "Add Mapper".
Select "Attribute Importer" and use the following settings:
Name: firstName
Friendly Name: givenName
Name format: ATTRIBUTE_FORMAT_BASIC
User Attribute Name: firstName
next mapper:
Name: lastName
Friendly Name: surname
Name format: ATTRIBUTE_FORMAT_BASIC
User Attribute Name: lastName
3. Try to sign-in an application portected by Keycloak via your Okta IdP.