mirror of
https://github.com/grafana/grafana.git
synced 2025-08-02 23:03:01 +08:00
OAuth: Add custom unauthorized message option in configuration (#93717)
* read custom message from config * Read error key from bootdata * oopsie * Remove console.log * Update docs and sample/default inis * Add default key value to the config
This commit is contained in:
@ -263,6 +263,7 @@ type Cfg struct {
|
||||
|
||||
// OAuth
|
||||
OAuthAutoLogin bool
|
||||
OAuthLoginErrorMessage string
|
||||
OAuthCookieMaxAge int
|
||||
OAuthAllowInsecureEmailLookup bool
|
||||
OAuthRefreshTokenServerLockMinWaitMs int64
|
||||
@ -1621,6 +1622,8 @@ func readAuthSettings(iniFile *ini.File, cfg *Cfg) (err error) {
|
||||
cfg.Logger.Warn("[Deprecated] The oauth_auto_login configuration setting is deprecated. Please use auto_login inside auth provider section instead.")
|
||||
}
|
||||
|
||||
// Default to the translation key used in the frontend
|
||||
cfg.OAuthLoginErrorMessage = valueAsString(auth, "oauth_login_error_message", "oauth.login.error")
|
||||
cfg.OAuthCookieMaxAge = auth.Key("oauth_state_cookie_max_age").MustInt(600)
|
||||
cfg.OAuthRefreshTokenServerLockMinWaitMs = auth.Key("oauth_refresh_token_server_lock_min_wait_ms").MustInt64(1000)
|
||||
cfg.SignoutRedirectUrl = valueAsString(auth, "signout_redirect_url", "")
|
||||
|
Reference in New Issue
Block a user