You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+17-15
Original file line number
Diff line number
Diff line change
@@ -263,12 +263,12 @@ Example:
263
263
"tokenExpiry": 120,
264
264
"requestMappings": [
265
265
{
266
-
"requestParam": "scope",
267
-
"match": "scope1",
266
+
"requestParam": "code",
267
+
"match": "code1",
268
268
"claims": {
269
-
"sub": "subByScope",
269
+
"sub": "subByCode",
270
270
"aud": [
271
-
"audByScope"
271
+
"audByCode"
272
272
]
273
273
}
274
274
}
@@ -328,20 +328,20 @@ The following configuration will set the system time to `2020-01-21T00:00:00Z`:
328
328
329
329
*From the first JSON example above:*
330
330
331
-
A token request to `http://localhost:8080/issuer1/token` with parameter `scope` equal to `scope1` will match the first `tokenCallback`:
331
+
A token request to `http://localhost:8080/issuer1/token` with parameter `code` equal to `code1` will match the first `tokenCallback`:
332
332
333
333
```json
334
334
{
335
335
"issuerId": "issuer1",
336
336
"tokenExpiry": 120,
337
337
"requestMappings": [
338
338
{
339
-
"requestParam": "scope",
340
-
"match": "scope1",
339
+
"requestParam": "code",
340
+
"match": "code1",
341
341
"claims": {
342
-
"sub": "subByScope",
342
+
"sub": "subByCode",
343
343
"aud": [
344
-
"audByScope"
344
+
"audByCode"
345
345
]
346
346
}
347
347
}
@@ -353,8 +353,8 @@ and return a token response containing a token with the following claims:
353
353
354
354
```json
355
355
{
356
-
"sub": "subByScope",
357
-
"aud": "audByScope",
356
+
"sub": "subByCode",
357
+
"aud": "audByCode",
358
358
"nbf": 1616416942,
359
359
"iss": "http://localhost:54905/issuer1",
360
360
"exp": 1616417062,
@@ -363,6 +363,8 @@ and return a token response containing a token with the following claims:
363
363
}
364
364
```
365
365
366
+
Earlier versions of this documentation used `scope` as `requestParam` in the example. The scope request parameter is no logner supported by nimbus due to [c960757](https://github.com/navikt/mock-oauth2-server/commit/c9607571743cc087b190112f2197f4ac0a27aef2), so the call back needs to be configured with a different key.
367
+
366
368
Use variable `clientId` to set `sub` claim for Client Credentials Grant dynamically.
367
369
368
370
A token request with client credentials where `clientId = myClientId` and `tokenCallback`:
@@ -372,12 +374,12 @@ A token request with client credentials where `clientId = myClientId` and `token
372
374
"tokenExpiry": 120,
373
375
"requestMappings": [
374
376
{
375
-
"requestParam": "scope",
376
-
"match": "scope1",
377
+
"requestParam": "code",
378
+
"match": "code1",
377
379
"claims": {
378
380
"sub": "${clientId}",
379
381
"aud": [
380
-
"audByScope"
382
+
"audByCode"
381
383
]
382
384
}
383
385
}
@@ -390,7 +392,7 @@ will return a token response containing a token with the following claims:
0 commit comments