added OAuth2 displayName and pkce options

This commit is contained in:
Gani Georgiev
2023-11-29 20:19:54 +02:00
parent 995733000f
commit b283ee2263
65 changed files with 421 additions and 226 deletions

View File

@@ -620,6 +620,8 @@ type AuthProviderConfig struct {
AuthUrl string `form:"authUrl" json:"authUrl"`
TokenUrl string `form:"tokenUrl" json:"tokenUrl"`
UserApiUrl string `form:"userApiUrl" json:"userApiUrl"`
DisplayName string `form:"displayName" json:"displayName"`
PKCE *bool `form:"pkce" json:"pkce"`
}
// Validate makes `ProviderConfig` validatable by implementing [validation.Validatable] interface.
@@ -659,6 +661,14 @@ func (c AuthProviderConfig) SetupProvider(provider auth.Provider) error {
provider.SetTokenUrl(c.TokenUrl)
}
if c.DisplayName != "" {
provider.SetDisplayName(c.DisplayName)
}
if c.PKCE != nil {
provider.SetPKCE(*c.PKCE)
}
return nil
}