Skip to content

Commit d3ab832

Browse files
committed
docs: Update documentation to explain partial token responses
1 parent afa6120 commit d3ab832

2 files changed

Lines changed: 29 additions & 0 deletions

File tree

documentation/getting-started.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ so some information might change depending on which version and branch you're us
4343
- [Authentication methods](#authentication-methods)
4444
- [Customizing OIDC verification](#customizing-oidc-verification)
4545
+ [Generate token](#generate-token)
46+
- [Partial permission tokens](#partial-permission-tokens)
4647
+ [Use token](#use-token)
4748
* [Policies](#policies)
4849
+ [Client application identification](#client-application-identification)
@@ -381,6 +382,32 @@ If successful, the server will return a 200 response with a JSON body containing
381382
an `access_token` field containing the access token, and a `token_type` field describing the token type.
382383
If the claims are insufficient, a 403 response will be given instead.
383384

385+
#### Partial permission tokens
386+
387+
It is possible to set up the server so it also returns tokens
388+
if only some of the requested permissions are granted,
389+
instead of returning a 403 response.
390+
This can be useful for setups where the RS requires only one of the requested permissions to perform a request.
391+
The disadvantage is that the client might receive a token
392+
that does not have all permissions to perform the intended action.
393+
394+
To enable this, start the UMA server with both `default.json` and `enable-partial.json`.
395+
396+
From the repository root:
397+
```bash
398+
yarn start:uma -- -c ./config/default.json -c ./config/enable-partial.json
399+
```
400+
401+
From `packages/uma`:
402+
```bash
403+
yarn start -c ./config/default.json -c ./config/enable-partial.json
404+
```
405+
406+
With this enabled:
407+
- If at least one requested permission can be authorized, the AS returns `200` with an access token.
408+
- If not all requested permissions are granted, that response body includes `partial: true`.
409+
- If no requested permission can be authorized, the AS returns `403`.
410+
384411
### Use token
385412

386413
When receiving the access token, the client can perform the same request as it did in the first step,

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@
5656
"build": "yarn workspaces foreach --include 'packages/*' -A -pi -j unlimited -t run build",
5757
"test": "vitest run",
5858
"start": "yarn workspaces foreach --include 'packages/*' -A -pi -j unlimited run start",
59+
"start:uma": "yarn workspace @solidlab/uma run start",
60+
"start:css": "yarn workspace @solidlab/uma-css run start",
5961
"start:odrl": "yarn workspace @solidlab/uma run start:odrl & yarn workspace @solidlab/uma-css run start",
6062
"start:demo": "yarn workspaces foreach --include 'packages/*' -A -pi -j unlimited run demo",
6163
"script:demo": "yarn exec tsx ./demo/flow.ts",

0 commit comments

Comments
 (0)