OAuth : Introduce new setting for configuring max age of OAuth state cookie (#23195)

* Cookie : Increase duration to avoid error

When using oauth2 authentication with multifactor, the 60s delay may be too short

* Introduce new setting for OAuth state cookie max age

Co-authored-by: Sofia Papagiannaki <sofia@grafana.com>
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
rtrompier
2020-03-30 17:44:58 +03:00
committed by GitHub
co-authored by Sofia Papagiannaki Arve Knudsen
parent f1548b4b11
commit 474dac1501
5 changed files with 16 additions and 1 deletions
+4
View File
@@ -268,6 +268,9 @@ type Cfg struct {
LoginMaxLifetimeDays int
TokenRotationIntervalMinutes int
// OAuth
OAuthCookieMaxAge int
// SAML Auth
SAMLEnabled bool
@@ -848,6 +851,7 @@ func (cfg *Cfg) Load(args *CommandLineArgs) error {
DisableLoginForm = auth.Key("disable_login_form").MustBool(false)
DisableSignoutMenu = auth.Key("disable_signout_menu").MustBool(false)
OAuthAutoLogin = auth.Key("oauth_auto_login").MustBool(false)
cfg.OAuthCookieMaxAge = auth.Key("oauth_state_cookie_max_age").MustInt(60)
SignoutRedirectUrl, err = valueAsString(auth, "signout_redirect_url", "")
if err != nil {
return err