Zum Hauptinhalt springen

Übersicht

Casdoor basiert auf OAuth und verwendet Tokens als OAuth-Tokens der Benutzer.

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

Die folgenden Token-Felder sind in Casdoor verfügbar:

  • Owner
  • Name
  • CreatedTime
  • Application
  • Organization
  • User
  • Code
  • AccessToken
  • ExpireIn (Tokens verfallen nach Stunden)
  • Scope (Umfang der Autorisierung)
  • TokenType (z.B. vom Typ Bearer)

Nach dem Einloggen in die Anwendung gibt es drei Optionen, um ein JWT-Token zu generieren:

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

Die Optionen sind wie folgt: JWT wird ein Token generieren, das alle Benutzerfelder enthält, JWT-Empty wird ein Token mit allen nicht-leeren Werten für den Benutzer generieren, und JWT-Custom wird ein Token generieren, das benutzerdefinierte User Token-Felder enthält (Sie können Attribute in den Token-Feldern auswählen). 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