Skip to content

Commit

Permalink
docs: add jwt custom (#589)
Browse files Browse the repository at this point in the history
  • Loading branch information
SamYSF authored Jan 10, 2024
1 parent 2faafe2 commit 9cf4e63
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/application/terminology.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ authors: [ErikQQY]
- `ClientId`: OAuth client ID.
- `ClientSecret`: OAuth client secret.
- `RedirectUris`: Casdoor will navigate to one of the URIs if the user logged in successfully.
- `TokenFormat`: The format of the generated token. It can be either `JWT` (containing all `User` fields) or `JWT-Empty` containing all non-empty values.
- `TokenFormat`: The format of the generated token. It can be in the following formats: `JWT` (containing all `User` fields), `JWT-Empty` (containing all non-empty values) or `JWT-Custom` customizing `User` fields inside access token.
- `ExpireInHours`: Login will expire after hours.
- `SigninUrl`:
- `SignupUrl`: If you provide a sign-up service independently outside of Casdoor, please fill in the URL here.
Expand Down
7 changes: 5 additions & 2 deletions docs/token/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,12 @@ The following are the available token fields in Casdoor:
- `Scope` (Scope of authorization)
- `TokenType` (e.g., `Bearer` type)

After logging into the application, there are two options to generate a JWT Token:
After logging into the application, there are three options to generate a JWT Token:

- `JWT`
- `JWT-Empty`
- `JWT-Custom`

The `JWT` option will create a token with all fields of the `User` object, while the `JWT-Empty` option will create a token with all non-empty values for the user.
The options are as follows: JWT will generate a token containing all User fields, JWT-Empty will generate a token with all non-empty values for the user, and JWT-Custom will generate a token containing custom User Token fields (you can choose attributes in the Token fields).

![JWT-Custom](/img/token/overview/JWT-Custom.png)
Binary file added static/img/token/overview/JWT-Custom.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 9cf4e63

Please sign in to comment.