Commit 44f15e7
committed
feat(oauth2): populate groups claim in client_credentials tokens
Add a ClientCredentialsClaims sub-struct to the Client definition,
allowing static clients to declare identity claims (starting with
groups) that are included in tokens issued via client_credentials.
This keeps the Client struct focused on application-level concerns
(ID, secret, redirect URIs) while providing a dedicated home for
identity attributes needed by RBAC-aware consumers.
Configuration example:
staticClients:
- id: my-service
secret: "..."
clientCredentialsClaims:
groups:
- admin-group
When the groups scope is requested in a client_credentials grant,
the groups from clientCredentialsClaims are included in the token.
If clientCredentialsClaims is not set, behavior is unchanged.
Fixes #4690
Signed-off-by: Carles Arnal <carlesarnal92@gmail.com>1 parent 896c695 commit 44f15e7
3 files changed
Lines changed: 65 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1880 | 1880 | | |
1881 | 1881 | | |
1882 | 1882 | | |
1883 | | - | |
| 1883 | + | |
1884 | 1884 | | |
1885 | | - | |
| 1885 | + | |
| 1886 | + | |
1886 | 1887 | | |
1887 | 1888 | | |
1888 | | - | |
| 1889 | + | |
| 1890 | + | |
| 1891 | + | |
| 1892 | + | |
1889 | 1893 | | |
1890 | 1894 | | |
1891 | 1895 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1068 | 1068 | | |
1069 | 1069 | | |
1070 | 1070 | | |
1071 | | - | |
1072 | | - | |
1073 | | - | |
1074 | | - | |
1075 | | - | |
1076 | | - | |
1077 | | - | |
1078 | | - | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
1079 | 1081 | | |
1080 | 1082 | | |
1081 | 1083 | | |
| |||
1115 | 1117 | | |
1116 | 1118 | | |
1117 | 1119 | | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
1118 | 1142 | | |
1119 | 1143 | | |
1120 | 1144 | | |
| |||
1155 | 1179 | | |
1156 | 1180 | | |
1157 | 1181 | | |
1158 | | - | |
1159 | | - | |
1160 | | - | |
1161 | | - | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
1162 | 1187 | | |
1163 | 1188 | | |
1164 | 1189 | | |
| |||
1214 | 1239 | | |
1215 | 1240 | | |
1216 | 1241 | | |
1217 | | - | |
1218 | | - | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
1219 | 1245 | | |
1220 | 1246 | | |
1221 | 1247 | | |
| |||
1226 | 1252 | | |
1227 | 1253 | | |
1228 | 1254 | | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
1229 | 1261 | | |
1230 | 1262 | | |
1231 | 1263 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
194 | 206 | | |
195 | 207 | | |
196 | 208 | | |
| |||
0 commit comments