Skip to content

Commit 8137c14

Browse files
afaranhaxek
andcommitted
Documentation for Federated (OIDC) Keystone adoption
Jira: https://redhat.atlassian.net/browse/OSPRH-19963 Signed-off-by: Andre Aranha <afariasa@redhat.com> Co-authored-by: Grzegorz Grasza <xek@redhat.com>
1 parent a10ba73 commit 8137c14

2 files changed

Lines changed: 129 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: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
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 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.
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+
where:
23+
24+
`<keycloak-ca.crt>`:: Replace with the path to the CA file you want to use.
25+
26+
. Create the `keystone-httpd-override` secret that provides the Apache HTTPD overrides that are required for OIDC:
27+
+
28+
[source,yaml]
29+
----
30+
apiVersion: v1
31+
kind: Secret
32+
metadata:
33+
name: keystone-httpd-override
34+
namespace: openstack
35+
type: Opaque
36+
stringData:
37+
federation.conf: |
38+
OIDCClaimPrefix "OIDC-"
39+
OIDCResponseType "code"
40+
OIDCScope "openid profile email"
41+
OIDCClaimDelimiter ","
42+
OIDCPassUserInfoAs "payload"
43+
OIDCPassClaimsAs "both"
44+
OIDCProviderMetadataURL "https://keycloak-openstack.apps-crc.testing/auth/realms/openstack/.well-known/openid-configuration"
45+
OIDCClientID "rhoso"
46+
OIDCClientSecret "<client_secret>"
47+
OIDCCryptoPassphrase "<crypto_passphrase>"
48+
OIDCOAuthClientID "rhoso"
49+
OIDCOAuthClientSecret "<client_secret>"
50+
OIDCOAuthIntrospectionEndpoint "https://keycloak-openstack.apps-crc.testing/auth/realms/openstack/protocol/openid-connect/token/introspect"
51+
OIDCRedirectURI "https://keystone-public-openstack.apps-crc.testing/v3/auth/OS-FEDERATION/identity_providers/kcIDP/protocols/openid/websso/"
52+
LogLevel debug
53+
54+
<LocationMatch "/v3/auth/OS-FEDERATION/identity_providers/kcIDP/protocols/openid/websso">
55+
AuthType "openid-connect"
56+
Require valid-user
57+
</LocationMatch>
58+
59+
<Location "/v3/OS-FEDERATION/identity_providers/kcIDP/protocols/openid/auth">
60+
AuthType oauth20
61+
Require valid-user
62+
</Location>
63+
64+
<LocationMatch "/v3/auth/OS-FEDERATION/websso/openid">
65+
AuthType "openid-connect"
66+
Require valid-user
67+
</LocationMatch>
68+
----
69+
+
70+
where:
71+
72+
`<client_secret>`:: Replace with your client ID to use for the OIDC provider handshake. You must get this from your SSO administrator.
73+
`<crypto_passphrase>`:: Replace with the client secret to use for the OIDC provider handshake. You must get this from your SSO administrator after providing your redirect URLs.
74+
`<LocationMatch>` and `<Location>`:: Replace with the chosen string that creates your unique redirect URL.
75+
76+
. Patch the `OpenStackControlPlane` custom resource (CR) to enable OIDC federation for Keystone:
77+
+
78+
[source,yaml]
79+
----
80+
spec:
81+
tls:
82+
caBundleSecretName: keycloakca
83+
keystone:
84+
template:
85+
customServiceConfig: |
86+
[token]
87+
expiration = 360000
88+
[federation]
89+
trusted_dashboard=https://horizon-openstack.apps-crc.testing/dashboard/auth/websso/
90+
sso_callback_template=/etc/keystone/sso_callback_template.html
91+
[openid]
92+
remote_id_attribute=HTTP_OIDC_ISS
93+
[auth]
94+
methods = password,token,oauth1,mapped,application_credential,openid
95+
[trusted_ip]
96+
trusted_forwarded_for_header=True
97+
httpdCustomization:
98+
customConfigSecret: keystone-httpd-override
99+
----
100+
+
101+
* Ensure you merge the patch with any existing custom configuration for the {identity_service}.
102+
103+
.Verification
104+
105+
. Request a federated token before adoption:
106+
+
107+
----
108+
$ openstack token issue
109+
----
110+
+
111+
This command should return an access token that is issued for the federated user.
112+
113+
. Verify the token against the newly adopted {identity_service} instance:
114+
+
115+
----
116+
$ oc exec -t openstackclient -- env -u OS_CLOUD - \
117+
OS_AUTH_URL=https://keystone-public-openstack.apps-crc.testing/v3 \
118+
OS_AUTH_TYPE=v3oidcaccesstoken \
119+
OS_ACCESS_TOKEN=$(openstack token issue -f value -c id) \
120+
openstack project show <project_id>
121+
----
122+
+
123+
where:
124+
125+
`<project_id>`:: Replace with the ID of your OpenStack project.
126+
+
127+
A successful response confirms that the federated OIDC configuration is active on the podified Keystone deployment.

0 commit comments

Comments
 (0)