add "username" as claim key (#98)

This commit is contained in:
fliaping
2024-03-15 19:29:00 +08:00
committed by GitHub
parent db00db131b
commit 6325c0c4b7

View File

@@ -99,7 +99,7 @@ func (h *OIDC) HandleCallback(w http.ResponseWriter, r *http.Request) {
}
func findUsernameInClaims(data map[string]interface{}) string {
candidates := []string{"preferred_username", "unique_name", "upn"}
candidates := []string{"preferred_username", "unique_name", "upn", "username"}
for _, claim := range candidates {
userName, found := data[claim].(string)
if found {