Огляд
Casdoor побудований на основі OAuth та використовує токени як OAuth токени користувачів.
Access Token and ID Token
In Casdoor, the access_token and id_token are identical. Both tokens contain the same JWT payload with user information and claims. This is a design choice in Casdoor that simplifies token management.
This approach means:
- Both tokens contain the same user information and custom claims
- Both tokens can be used interchangeably for authentication and authorization
- The token format and expiration settings apply to both tokens equally
- You cannot configure separate claims for
access_tokenandid_token
Token Fields
Нижче наведено доступні поля токенів у Casdoor:
OwnerNameCreatedTimeApplicationOrganizationUserCodeAccessTokenExpireIn(Токени закінчуються через години)Scope(Обсяг авторизації)TokenType(наприклад, типBearer)
Після входу в додаток є три варіанти генерації JWT токена:
JWTJWT-EmptyJWT-CustomJWT-Standard
Варіанти наступні: JWT згенерує токен, що містить усі поля користувача, JWT-Empty згенерує токен з усіма непорожніми значеннями для користувача, а JWT-Custom згенерує токен, що містить настраивані поля токена користувача (ви можете обрати атрибути у полях токена). JWT-Standard will generate a token with some standard OIDC token fields include email, phone, gender and Address (Address value in other format is not standard).
