Resolve issue #85 by adding ability to set custom claims in JWT tokens

This commit is contained in:
2025-10-22 20:18:02 +01:00
parent ad3c85c6b6
commit bc53d4ef15
8 changed files with 432 additions and 9 deletions
+12
View File
@@ -165,6 +165,18 @@ func NewWithContext(ctx context.Context, config *Config, next http.Handler, name
}
return config.ClientID
}(),
roleClaimName: func() string {
if config.RoleClaimName != "" {
return config.RoleClaimName
}
return "roles" // Backward compatible default
}(),
groupClaimName: func() string {
if config.GroupClaimName != "" {
return config.GroupClaimName
}
return "groups" // Backward compatible default
}(),
forceHTTPS: config.ForceHTTPS,
enablePKCE: config.EnablePKCE,
overrideScopes: config.OverrideScopes,