feat: JWT-Service mit Unterstützung für UserReadDto-Ansprüche hinzufügen
- ToClaimDictionary-Erweiterungsmethode hinzugefügt, um die Ansprüche von UserReadDto in ein Wörterbuch zu konvertieren. - JWT-Service konfiguriert, um Tokens mit Ansprüchen aus UserReadDto zu generieren. - JWT-Service in die Authentifizierungskonfiguration integriert.
This commit is contained in:
@@ -12,5 +12,7 @@ namespace WorkFlow.API.Models
|
||||
new (ClaimTypes.GivenName, user.Prename ?? ""),
|
||||
new (ClaimTypes.Email, user.Email ?? "")
|
||||
];
|
||||
|
||||
public static Dictionary<string, object> ToClaimDictionary(this UserReadDto user) => user.ToClaimList().ToDictionary(claim => claim.Type, claim => (object) claim.Value);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user