Skip to content

Commit

Permalink
salt,ui: Prefix OIDC claims with oidc:
Browse files Browse the repository at this point in the history
This is needed to avoid name collision between
different authentication plugins.

Refs: #3051
  • Loading branch information
alexandre-allard committed Jan 20, 2021
1 parent fcde4b7 commit 5968792
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
## Release 2.8.0 (in development)
### Enhancements

- [#3051](https://github.com/scality/metalk8s/issues/3051) - Prefix OIDC claims
to prevent naming clashes
(PR [#3054](https://github.com/scality/metalk8s/pull/3054))

- [#2164](https://github.com/scality/metalk8s/issues/2164) - Add RHEL 8 support
(PR [#2997](https://github.com/scality/metalk8s/pull/2997))

Expand Down
2 changes: 1 addition & 1 deletion docs/operation/account_administration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ these steps:
name: <role-binding-name-of-your-choice>
subjects:
- kind: User
name: <email>
name: oidc:<email>
apiGroup: rbac.authorization.k8s.io
roleRef:
kind: ClusterRole
Expand Down
2 changes: 1 addition & 1 deletion salt/metalk8s/addons/dex/deployed/clusterrolebinding.sls
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: dex-administrator
subjects:
- kind: User
name: "[email protected]"
name: "oidc:[email protected]"
apiGroup: rbac.authorization.k8s.io
roleRef:
kind: ClusterRole
Expand Down
2 changes: 2 additions & 0 deletions salt/metalk8s/kubernetes/apiserver/installed.sls
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ Create kube-apiserver Pod manifest:
- --oidc-client-id=oidc-auth-client
- --oidc-ca-file=/etc/metalk8s/pki/nginx-ingress/ca.crt
- --oidc-username-claim=email
- --oidc-username-prefix="oidc:"
- --oidc-groups-claim=groups
- --oidc-groups-prefix="oidc:"
- --v={{ 2 if metalk8s.debug else 0 }}
requested_cpu: 250m
volumes:
Expand Down
2 changes: 1 addition & 1 deletion ui/cypress/fixtures/salt-api/login.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"start": 1603349562.577489,
"token": "fc14fe8d2c99b575642546ee219cc714204cf31a",
"expire": 1603392762.577489,
"user": "[email protected]",
"user": "oidc:[email protected]",
"eauth": "kubernetes_rbac"
}
]
Expand Down
2 changes: 1 addition & 1 deletion ui/src/services/salt/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export type SaltToken = {
export function authenticate(user): Promise<SaltToken> {
var payload = {
eauth: 'kubernetes_rbac',
username: user.profile.email,
username: `oidc:${user.profile.email}`,
token: user.id_token,
};
return saltApiClient.post('/login', payload);
Expand Down

0 comments on commit 5968792

Please sign in to comment.