Skip to content

Commit 8ee69b4

Browse files
authored
Merge pull request #1496 from rackerlabs/keystone-auth-device-auth
feat(keystone): add OAuth 2.0 authentication options
2 parents beefed9 + 1c67aef commit 8ee69b4

File tree

3 files changed

+42
-2
lines changed

3 files changed

+42
-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/dex/values.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,30 @@ envVars:
108108
name: oidc-sso
109109
key: redirect-uri
110110
optional: true
111+
- name: CONNECTOR_SSO_ISSUER
112+
valueFrom:
113+
secretKeyRef:
114+
name: connector-sso
115+
key: issuer
116+
optional: true
117+
- name: CONNECTOR_SSO_CLIENT_ID
118+
valueFrom:
119+
secretKeyRef:
120+
name: connector-sso
121+
key: client-id
122+
optional: true
123+
- name: CONNECTOR_SSO_CLIENT_SECRET
124+
valueFrom:
125+
secretKeyRef:
126+
name: connector-sso
127+
key: client-secret
128+
optional: true
129+
- name: CONNECTOR_SSO_REDIRECT_URI
130+
valueFrom:
131+
secretKeyRef:
132+
name: connector-sso
133+
key: redirect-uri
134+
optional: true
111135
- name: GRAFANA_SSO_CLIENT_SECRET
112136
valueFrom:
113137
secretKeyRef:

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)