File tree 3 files changed +9
-12
lines changed
3 files changed +9
-12
lines changed Original file line number Diff line number Diff line change @@ -89,26 +89,23 @@ kubectl create -f dex-deploy.yml
89
89
90
90
Now it should work: try https://login.k8s.example.org , login and retrieve k8s configuration.
91
91
92
- ``` shell
93
- kubectl --user=janedoe get po
94
- Error from server (Forbidden): pods is forbidden: User " https://dex.k8s.example.org/dex#janedoe" cannot list pods in the namespace " auth"
95
- ```
92
+ You can decode the id_token to verify the returned claims using: https://jwt.io/
96
93
97
- User prefix can be updated with the ** --oidc-username-prefix** apiserver option.
98
-
99
- * Create RBAC resource:
94
+ * Create RBAC resource (assgin a group called "admins" cluster admin role):
100
95
101
96
``` shell
102
- kubectl create -f rbac-admins .yml
97
+ kubectl create -f rbac.yml
103
98
```
104
99
105
- Try again :
100
+ Now copy paste the returned ~ /.kube/config from loginapp and try :
106
101
107
102
``` shell
108
- kubectl --user=janedoe get po
103
+ kubectl get po
109
104
NAME READY STATUS RESTARTS AGE
110
105
dex-6f6568d499-m89z6 1/1 Running 0 7m
111
106
loginapp-6474748f4b-gb5kb 1/1 Running 0 8m
112
107
loginapp-6474748f4b-prq25 1/1 Running 0 8m
113
108
loginapp-6474748f4b-vnvnb 1/1 Running 0 8m
114
109
```
110
+
111
+ You can also use id_token for signing on the k8s dashboard
Original file line number Diff line number Diff line change 93
93
skipApprovalScreen: true
94
94
95
95
staticClients:
96
- - id: login
96
+ - id: loginapp
97
97
redirectURIs:
98
98
- 'https://login.k8s.example.org:32002/callback'
99
99
name: 'Login Application'
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ metadata:
7
7
data :
8
8
config.yaml : |
9
9
debug: false
10
- client_id: "login "
10
+ client_id: "loginapp "
11
11
client_secret: 4TORGiNV9M54BTk1v7dNuFSaI6hUjfjr
12
12
issuer_url: "https://dex.k8s.example.org:32000/dex"
13
13
issuer_root_ca: "/etc/ssl/ca.pem"
You can’t perform that action at this time.
0 commit comments