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:
Developer 02
2024-10-25 14:51:50 +02:00
parent 730b218eb5
commit 41151593fd
2 changed files with 10 additions and 0 deletions

View File

@@ -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);
}
}