Passer au contenu principal

Aperçu

Casdoor est construit sur OAuth et utilise des jetons comme jetons OAuth des utilisateurs.

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_token and id_token

Token Fields

Voici les champs de jeton disponibles dans Casdoor :

  • Owner
  • Name
  • CreatedTime
  • Application
  • Organization
  • User
  • Code
  • AccessToken
  • ExpireIn (Les jetons expireront en heures)
  • Scope (Portée de l'autorisation)
  • TokenType (par exemple, type Bearer)

Après s'être connecté à l'application, il y a trois options pour générer un jeton JWT :

  • JWT
  • JWT-Empty
  • JWT-Custom
  • JWT-Standard

Les options sont les suivantes : JWT générera un jeton contenant tous les champs Utilisateur, JWT-Empty générera un jeton avec toutes les valeurs non vides pour l'utilisateur, et JWT-Custom générera un jeton contenant des champs de jeton Utilisateur personnalisés (vous pouvez choisir des attributs dans les champs de jeton). 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).

JWT-Custom