Skip to content

Commit 47064a9

Browse files
committed
Documentation for Federated (OIDC) Keystone adoption
1 parent 095c453 commit 47064a9

2 files changed

Lines changed: 119 additions & 0 deletions

File tree

docs_user/assemblies/assembly_adopting-openstack-control-plane-services.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ Adopt your {rhos_prev_long} {rhos_prev_ver} control plane services to deploy the
1212

1313
include::../modules/proc_adopting-the-identity-service.adoc[leveloffset=+1]
1414

15+
include::../modules/proc_configuring-federation-for-keystone.adoc[leveloffset=+1]
16+
1517
include::../modules/proc_configuring-ldap-with-domain-specific-drivers.adoc[leveloffset=+1]
1618

1719
include::../modules/proc_adopting-key-manager-service.adoc[leveloffset=+1]
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
_mod-docs-content-type: PROCEDURE
2+
[id='configuring-federation-for-keystone_{context}']
3+
4+
= Configuring OIDC federation for the Identity service
5+
6+
To let {identity_service_first_ref} trust an external OpenID Connect (OIDC) identity provider, apply the federation configuration and verify that federated users can authenticate.
7+
8+
.Prerequisites
9+
10+
* You have Keycloak reachable from your {rhos_long} cluster.
11+
* You have access to the Keycloak `keycloak-ca.crt` file that corresponds to its certificate chain.
12+
13+
.Procedure
14+
15+
. Create the `keycloakca` secret so that the {identity_service} pods trust the Keycloak certificate authority (CA):
16+
+
17+
----
18+
$ oc create secret generic keycloakca \
19+
--from-file=KeyCloakCA=keycloak-ca.crt -n openstack
20+
----
21+
+
22+
* Replace `keycloak-ca.crt` with the path to the CA file you want to use.
23+
24+
. Create the `keystone-httpd-override` secret that provides the Apache HTTPD overrides required for OIDC:
25+
+
26+
[source,yaml]
27+
----
28+
apiVersion: v1
29+
kind: Secret
30+
metadata:
31+
name: keystone-httpd-override
32+
namespace: openstack
33+
type: Opaque
34+
stringData:
35+
federation.conf: |
36+
OIDCClaimPrefix "OIDC-"
37+
OIDCResponseType "code"
38+
OIDCScope "openid profile email"
39+
OIDCClaimDelimiter ","
40+
OIDCPassUserInfoAs "payload"
41+
OIDCPassClaimsAs "both"
42+
OIDCProviderMetadataURL "https://keycloak-openstack.apps-crc.testing/auth/realms/openstack/.well-known/openid-configuration"
43+
OIDCClientID "rhoso"
44+
OIDCClientSecret "<client_secret>"
45+
OIDCCryptoPassphrase "<crypto_passphrase>"
46+
OIDCOAuthClientID "rhoso"
47+
OIDCOAuthClientSecret "<client_secret>"
48+
OIDCOAuthIntrospectionEndpoint "https://keycloak-openstack.apps-crc.testing/auth/realms/openstack/protocol/openid-connect/token/introspect"
49+
OIDCRedirectURI "https://keystone-public-openstack.apps-crc.testing/v3/auth/OS-FEDERATION/identity_providers/kcIDP/protocols/openid/websso/"
50+
LogLevel debug
51+
52+
<LocationMatch "/v3/auth/OS-FEDERATION/identity_providers/kcIDP/protocols/openid/websso">
53+
AuthType "openid-connect"
54+
Require valid-user
55+
</LocationMatch>
56+
57+
<Location "/v3/OS-FEDERATION/identity_providers/kcIDP/protocols/openid/auth">
58+
AuthType oauth20
59+
Require valid-user
60+
</Location>
61+
62+
<LocationMatch "/v3/auth/OS-FEDERATION/websso/openid">
63+
AuthType "openid-connect"
64+
Require valid-user
65+
</LocationMatch>
66+
----
67+
+
68+
* Replace the placeholder values, such as `<client_secret>` and `<crypto_passphrase>`, with the credentials that match your Keycloak deployment.
69+
70+
. Patch the `OpenStackControlPlane` custom resource (CR) to enable OIDC federation for Keystone:
71+
+
72+
[source,yaml]
73+
----
74+
spec:
75+
tls:
76+
caBundleSecretName: keycloakca
77+
keystone:
78+
template:
79+
customServiceConfig: |
80+
[token]
81+
expiration = 360000
82+
[federation]
83+
trusted_dashboard=https://horizon-openstack.apps-crc.testing/dashboard/auth/websso/
84+
sso_callback_template=/etc/keystone/sso_callback_template.html
85+
[openid]
86+
remote_id_attribute=HTTP_OIDC_ISS
87+
[auth]
88+
methods = password,token,oauth1,mapped,application_credential,openid
89+
[trusted_ip]
90+
trusted_forwarded_for_header=True
91+
httpdCustomization:
92+
customConfigSecret: keystone-httpd-override
93+
----
94+
+
95+
* Ensure you merge the patch with any existing custom configuration for the {identity_service}.
96+
97+
.Verification
98+
99+
. Request a federated token before adoption:
100+
+
101+
----
102+
$ openstack token issue
103+
----
104+
+
105+
This command should return an access token issued for the federated user.
106+
107+
. Verify the token against the newly adopted {identity_service} instance:
108+
+
109+
----
110+
$ oc exec -t openstackclient -- env -u OS_CLOUD - \
111+
OS_AUTH_URL=https://keystone-public-openstack.apps-crc.testing/v3 \
112+
OS_AUTH_TYPE=v3oidcaccesstoken \
113+
OS_ACCESS_TOKEN=$(openstack token issue -f value -c id) \
114+
openstack project show <project id>
115+
----
116+
+
117+
A successful response confirms that the federated OIDC configuration is active on the podified Keystone deployment.

0 commit comments

Comments
 (0)