Skip to content

Commit 150dda5

Browse files
committed
feat(keystone): add OAuth 2.0 authentication options
The device authorization and the client credentials flows are OAuth 2.0 flows instead of OIDC so we need to be able to validate the token submitted against the endpoint so we need to also read the metadata for the OAuth 2.0 paths of mod_auth_openidc. Add another authentication endpoint into apache for Keystone so that we can route the authentication request to the correct connector inside of Dex to successfully complete the authentication.
1 parent ff13d9c commit 150dda5

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

ansible/roles/keystone_bootstrap/tasks/sso.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@
6464
idp: sso
6565
mapping: sso_mapping
6666

67+
- name: Create mapped protocol
68+
openstack.cloud.keystone_federation_protocol:
69+
name: mapped
70+
idp: sso
71+
mapping: sso_mapping
72+
6773
- name: Create federated group mappings
6874
ansible.builtin.include_tasks: sso_groups.yml
6975
loop: "{{ keystone_bootstrap_groups }}"

components/keystone/values.yaml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,9 @@ conf:
223223
OIDCXForwardedHeaders X-Forwarded-Host X-Forwarded-Proto X-Forwarded-Port
224224
225225
# OIDC provider's .well-known/configuration URL
226-
OIDCProviderMetadataURL {{ tuple "dex" "internal" "dex" $ | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup" }}
226+
OIDCProviderMetadataURL {{ tuple "dex" "internal" "dex" $ | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup" }}/.well-known/openid-configuration
227+
# this is so that in the OAuth 2.0 flows we can validate the JWT token
228+
OIDCOAuthVerifyJwksUri {{ tuple "dex" "internal" "dex" $ | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup" }}/keys
227229
# Client / Application Identifier and Secret
228230
OIDCClientID keystone
229231
OIDCClientSecret "exec:/bin/cat /etc/keystone-sso/client-secret"
@@ -237,6 +239,7 @@ conf:
237239
238240
# set the REMOTE_USER to the value of preferred_username
239241
OIDCRemoteUserClaim preferred_username
242+
OIDCOAuthRemoteUserClaim preferred_username
240243
# scopes that we want to request
241244
OIDCScope "openid email profile groups"
242245
@@ -271,6 +274,13 @@ conf:
271274
Require valid-user
272275
AuthType openid-connect
273276
</Location>
277+
# add OAuth 2.0 support for the identity provider 'sso' using the 'mapped' protocol
278+
<Location /v3/OS-FEDERATION/identity_providers/sso/protocols/mapped/auth>
279+
Require valid-user
280+
AuthType oauth20
281+
# TODO: variablize this better
282+
OIDCPathAuthRequestParams connector_id=machine
283+
</Location>
274284
</VirtualHost>
275285
276286
@@ -317,7 +327,7 @@ endpoints:
317327
dex:
318328
# override this when full deployment
319329
default: 5556
320-
path: '/.well-known/openid-configuration'
330+
path: ''
321331

322332
manifests:
323333
job_credential_cleanup: false

0 commit comments

Comments
 (0)