SSO: Add prompt param to SSO settings (#107969)
* add prompt param to AzureAD oauth config * yarn i18n-extract * validate auth prompt value * make login_prompt available for all SSO providers * use base authCodeURL for azure and google * add docs for the new field for azure and generic oauth * fix typo * fix frontend unit test * add prompt parameter to docs for the other providers * remove prompt from okta * add unit tests for the other providers * address feedback * add back translations for prompt labels
This commit is contained in:
@@ -51,6 +51,15 @@ func SkipOrgRoleSyncAllowAssignGrafanaAdminValidator(info *social.OAuthInfo, req
|
||||
return nil
|
||||
}
|
||||
|
||||
func LoginPromptValidator(info *social.OAuthInfo, requester identity.Requester) error {
|
||||
prompt := info.LoginPrompt
|
||||
|
||||
if prompt != "" && prompt != "login" && prompt != "consent" && prompt != "select_account" {
|
||||
return ssosettings.ErrInvalidOAuthConfig("Invalid value for login_prompt. Valid values are: login, consent, select_account.")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func RequiredValidator(value string, name string) ssosettings.ValidateFunc[social.OAuthInfo] {
|
||||
return func(info *social.OAuthInfo, requester identity.Requester) error {
|
||||
if value == "" {
|
||||
|
||||
Reference in New Issue
Block a user