-
Notifications
You must be signed in to change notification settings - Fork 85
Documentation for Federated (OIDC) Keystone adoption #1397
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
Merged
openshift-merge-bot
merged 1 commit into
openstack-k8s-operators:main
from
afaranha:oidc_adoption
Jun 5, 2026
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
127 changes: 127 additions & 0 deletions
127
docs_user/modules/proc_configuring-federation-for-keystone.adoc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,127 @@ | ||
| :_mod-docs-content-type: PROCEDURE | ||
| [id="configuring-federation-for-keystone_{context}"] | ||
|
|
||
| = Configuring OIDC federation for the Identity service | ||
|
|
||
| [role="_abstract"] | ||
| To allow the {identity_service_first_ref} to trust an external OpenID Connect (OIDC) identity provider, apply the federation configuration and verify that federated users can authenticate. | ||
|
|
||
| .Prerequisites | ||
|
|
||
| * Keycloak is reachable from your {rhos_long} cluster. | ||
| * You have access to the Keycloak `keycloak-ca.crt` file that corresponds to its certificate chain. | ||
|
|
||
| .Procedure | ||
|
|
||
| . Create the `keycloakca` secret so that the {identity_service} pods trust the Keycloak certificate authority (CA): | ||
| + | ||
| ---- | ||
| $ oc create secret generic keycloakca \ | ||
| --from-file=KeyCloakCA=<keycloak-ca.crt> -n openstack | ||
| ---- | ||
| + | ||
| where: | ||
|
|
||
| `<keycloak-ca.crt>`:: Specifies the path to the CA file that you want to use. | ||
|
|
||
| . Create the `keystone-httpd-override` secret that provides the Apache HTTPD overrides that are required for OIDC: | ||
| + | ||
| [source,yaml] | ||
| ---- | ||
| apiVersion: v1 | ||
| kind: Secret | ||
| metadata: | ||
| name: keystone-httpd-override | ||
| namespace: openstack | ||
| type: Opaque | ||
| stringData: | ||
| federation.conf: | | ||
| OIDCClaimPrefix "OIDC-" | ||
| OIDCResponseType "code" | ||
| OIDCScope "openid profile email" | ||
| OIDCClaimDelimiter "," | ||
| OIDCPassUserInfoAs "payload" | ||
| OIDCPassClaimsAs "both" | ||
| OIDCProviderMetadataURL "https://keycloak-openstack.apps-crc.testing/auth/realms/openstack/.well-known/openid-configuration" | ||
| OIDCClientID "rhoso" | ||
| OIDCClientSecret "<client_secret>" | ||
| OIDCCryptoPassphrase "<crypto_passphrase>" | ||
| OIDCOAuthClientID "rhoso" | ||
| OIDCOAuthClientSecret "<client_secret>" | ||
| OIDCOAuthIntrospectionEndpoint "https://keycloak-openstack.apps-crc.testing/auth/realms/openstack/protocol/openid-connect/token/introspect" | ||
| OIDCRedirectURI "https://keystone-public-openstack.apps-crc.testing/v3/auth/OS-FEDERATION/identity_providers/kcIDP/protocols/openid/websso/" | ||
| LogLevel debug | ||
|
|
||
| <LocationMatch "/v3/auth/OS-FEDERATION/identity_providers/kcIDP/protocols/openid/websso"> | ||
| AuthType "openid-connect" | ||
| Require valid-user | ||
| </LocationMatch> | ||
|
|
||
| <Location "/v3/OS-FEDERATION/identity_providers/kcIDP/protocols/openid/auth"> | ||
| AuthType oauth20 | ||
| Require valid-user | ||
| </Location> | ||
|
|
||
| <LocationMatch "/v3/auth/OS-FEDERATION/websso/openid"> | ||
| AuthType "openid-connect" | ||
| Require valid-user | ||
| </LocationMatch> | ||
| ---- | ||
| + | ||
| where: | ||
|
|
||
| `<client_secret>`:: Specifies the client ID to use for the OIDC provider handshake. You must get the client ID from your SSO administrator. | ||
| `<crypto_passphrase>`:: Specifies the client secret to use for the OIDC provider handshake. You must get the client secret from your SSO administrator after providing your redirect URLs. | ||
| `<LocationMatch>` and `<Location>`:: Specifies the chosen string that creates your unique redirect URL. | ||
|
|
||
| . Patch the `OpenStackControlPlane` custom resource (CR) to enable OIDC federation for Keystone. Ensure that you merge the patch with any existing custom configuration for the {identity_service}: | ||
| + | ||
| [source,yaml] | ||
| ---- | ||
| spec: | ||
| tls: | ||
| caBundleSecretName: keycloakca | ||
| keystone: | ||
| template: | ||
| customServiceConfig: | | ||
| [token] | ||
| expiration = 360000 | ||
| [federation] | ||
| trusted_dashboard=https://horizon-openstack.apps-crc.testing/dashboard/auth/websso/ | ||
| sso_callback_template=/etc/keystone/sso_callback_template.html | ||
| [openid] | ||
| remote_id_attribute=HTTP_OIDC_ISS | ||
| [auth] | ||
| methods = password,token,oauth1,mapped,application_credential,openid | ||
| [trusted_ip] | ||
| trusted_forwarded_for_header=True | ||
| httpdCustomization: | ||
| customConfigSecret: keystone-httpd-override | ||
| ---- | ||
| + | ||
|
|
||
| .Verification | ||
|
|
||
| . Request a federated token before adoption: | ||
| + | ||
| ---- | ||
| $ openstack token issue | ||
| ---- | ||
| + | ||
| This command should return an access token that is issued for the federated user. | ||
|
|
||
| . Verify the token against the newly adopted {identity_service} instance: | ||
| + | ||
| ---- | ||
| $ oc exec -t openstackclient -- env -u OS_CLOUD - \ | ||
| OS_AUTH_URL=https://keystone-public-openstack.apps-crc.testing/v3 \ | ||
| OS_AUTH_TYPE=v3oidcaccesstoken \ | ||
| OS_ACCESS_TOKEN=$(openstack token issue -f value -c id) \ | ||
| openstack project show <project_id> | ||
| ---- | ||
| + | ||
| where: | ||
|
|
||
| `<project_id>`:: Replace with the ID of your OpenStack project. | ||
| + | ||
| A successful response confirms that the federated OIDC configuration is active on the podified Keystone deployment. | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.