Skip to content

Commit 79b4d80

Browse files
authored
fix(readme): replace scope with code (#754)
The scope request parameter is no longer supported. Follow up from #712
1 parent 29e2e45 commit 79b4d80

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

README.md

+17-15
Original file line numberDiff line numberDiff line change
@@ -263,12 +263,12 @@ Example:
263263
"tokenExpiry": 120,
264264
"requestMappings": [
265265
{
266-
"requestParam": "scope",
267-
"match": "scope1",
266+
"requestParam": "code",
267+
"match": "code1",
268268
"claims": {
269-
"sub": "subByScope",
269+
"sub": "subByCode",
270270
"aud": [
271-
"audByScope"
271+
"audByCode"
272272
]
273273
}
274274
}
@@ -328,20 +328,20 @@ The following configuration will set the system time to `2020-01-21T00:00:00Z`:
328328
329329
*From the first JSON example above:*
330330
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`:
332332
333333
```json
334334
{
335335
"issuerId": "issuer1",
336336
"tokenExpiry": 120,
337337
"requestMappings": [
338338
{
339-
"requestParam": "scope",
340-
"match": "scope1",
339+
"requestParam": "code",
340+
"match": "code1",
341341
"claims": {
342-
"sub": "subByScope",
342+
"sub": "subByCode",
343343
"aud": [
344-
"audByScope"
344+
"audByCode"
345345
]
346346
}
347347
}
@@ -353,8 +353,8 @@ and return a token response containing a token with the following claims:
353353
354354
```json
355355
{
356-
"sub": "subByScope",
357-
"aud": "audByScope",
356+
"sub": "subByCode",
357+
"aud": "audByCode",
358358
"nbf": 1616416942,
359359
"iss": "http://localhost:54905/issuer1",
360360
"exp": 1616417062,
@@ -363,6 +363,8 @@ and return a token response containing a token with the following claims:
363363
}
364364
```
365365
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+
366368
Use variable `clientId` to set `sub` claim for Client Credentials Grant dynamically.
367369
368370
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
372374
"tokenExpiry": 120,
373375
"requestMappings": [
374376
{
375-
"requestParam": "scope",
376-
"match": "scope1",
377+
"requestParam": "code",
378+
"match": "code1",
377379
"claims": {
378380
"sub": "${clientId}",
379381
"aud": [
380-
"audByScope"
382+
"audByCode"
381383
]
382384
}
383385
}
@@ -390,7 +392,7 @@ will return a token response containing a token with the following claims:
390392
```json
391393
{
392394
"sub": "myClientId",
393-
"aud": "audByScope",
395+
"aud": "audByCode",
394396
"nbf": 1616416942,
395397
"iss": "http://localhost:54905/issuer1",
396398
"exp": 1616417062,

0 commit comments

Comments
 (0)