ภาพรวม
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 Token:
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).
