Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keycloak saml sso docs #50819

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Keycloak saml sso docs #50819

wants to merge 7 commits into from

Conversation

oshati
Copy link
Contributor

@oshati oshati commented Jan 7, 2025

Closes #14490

This guide cover how to configure Keycloak SAML sso setup with Teleport

Copy link

github-actions bot commented Jan 7, 2025

Amplify deployment status

Branch Commit Job ID Status Preview Updated (UTC)
Keycloak-saml-sso-docs 66cca26 7 ✅SUCCEED keycloak-saml-sso-docs 2025-01-08 20:19:16

@oshati oshati marked this pull request as ready for review January 7, 2025 22:23
@oshati oshati requested review from programmerq and removed request for r0mant, mmcallister, zmb3, nklaassen and xinding33 January 7, 2025 22:24
docs/pages/admin-guides/access-controls/sso/keycloak.mdx Outdated Show resolved Hide resolved
docs/pages/admin-guides/access-controls/sso/keycloak.mdx Outdated Show resolved Hide resolved
docs/pages/admin-guides/access-controls/sso/keycloak.mdx Outdated Show resolved Hide resolved
docs/pages/admin-guides/access-controls/sso/keycloak.mdx Outdated Show resolved Hide resolved
docs/pages/admin-guides/access-controls/sso/keycloak.mdx Outdated Show resolved Hide resolved
## Step 1/3. Configure Keycloak

### Create a SAML Client
1. Select the Realm to be used for your SAML integration, Click **Clients** in the menu.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be:

1. To select the realm to be used for your SAML integration, click **Clients** in the menu.

...or:

1. Select the realm to be used for your SAML integration. Click **Clients** in the menu.

docs/pages/admin-guides/access-controls/sso/keycloak.mdx Outdated Show resolved Hide resolved
and the client will sign their saml requests and responses. The signature will be validated.


### Create Private Keys for Signing
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### Create Private Keys for Signing
### Create private keys for signing


(!docs/pages/includes/sso/loginerrortroubleshooting.mdx!)

Keycloak auth connector - Signature Validation Incompatibility
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Keycloak auth connector - Signature Validation Incompatibility
### Signature validation incompatibility

To add heading syntax and shorten the heading


![Import certificate](../../../../img/sso/keycloak/invalid_requester.png)

**Keycloak server logs:**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a separate heading? If so, I would use the ### <HEADING> syntax. Otherwise, I would use a sentence to transition from the preceding text.

![Edit client scope](../../../../img/sso/keycloak/attribute_mapping.png)

This enables using the username inside Teleport roles as the <nobr>`{{external.username}}`</nobr> property.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I installed a fresh Keycloak 26.0.7, and stepped through the guide. Teleport expected the SAML IDP to sign its assertions. I had to explicitly enable that in "Client details -> Settings -> Signature and Encryption -> Sign assertions". Note that this is separate from the section titled "Client Certificate Signature validation (Optional)"

Without that toggle enabled, I got the following in my Teleport Audit Log:

SSO user login failed [received response with incorrect or missing attribute statements, please check the identity provider configuration to make sure that mappings for claims/attribute statements are set up correctly. <See: https://goteleport.com/docs/admin-guides/access-controls/sso/>, failed to retrieve SAML assertion info from response: error validating response: response and/or assertions must be signed.]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Jeff! A little different behaviour on my Keycloak server 25.0.1. As it works without enabling "Sign assertions".

image

Although I wonder if the reason for that is the below, based on the additional information for Sign assertion?

Should assertions inside SAML documents be signed? This setting is not needed if document is already being signed.

## Step 2/3. Create a SAML connector

Now, create a SAML connector resource using `tctl`.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keycloak includes an explicit leading / in the group name. This should read --attributes-to-roles groups,/devops,dev. It would also be appropriate to call more attention to the /, or how to find out what your group names actually are in Keycloak. A screenshot of the keycloak users/groups screen could also be handy, but I don't think our other SSO guides go to that level of detail.

Co-authored-by: Paul Gottschling <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

docs: add guide for Keycloak SAML Provider
4 participants