mirror of
https://github.com/Luzifer/nginx-sso.git
synced 2024-12-20 04:41:17 +00:00
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
b84a79ed21
commit
09cf06c905
7 changed files with 18 additions and 2 deletions
3
main.go
3
main.go
|
@ -73,8 +73,7 @@ func init() {
|
|||
}
|
||||
|
||||
// Set sane defaults for main configuration
|
||||
mainCfg.Cookie.Prefix = "nginx-sso"
|
||||
mainCfg.Cookie.Expire = 3600
|
||||
mainCfg.Cookie = plugins.DefaultCookieConfig()
|
||||
mainCfg.Listen.Addr = "127.0.0.1"
|
||||
mainCfg.Listen.Port = 8082
|
||||
mainCfg.Login.DefaultRedirect = "debug"
|
||||
|
|
|
@ -64,6 +64,8 @@ func (a *AuthGoogleOAuth) Configure(yamlSource []byte) (err error) {
|
|||
} `yaml:"providers"`
|
||||
}{}
|
||||
|
||||
envelope.Cookie = plugins.DefaultCookieConfig()
|
||||
|
||||
if err := yaml.Unmarshal(yamlSource, &envelope); err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -62,6 +62,8 @@ func (a *AuthLDAP) Configure(yamlSource []byte) error {
|
|||
} `yaml:"providers"`
|
||||
}{}
|
||||
|
||||
envelope.Cookie = plugins.DefaultCookieConfig()
|
||||
|
||||
if err := yaml.Unmarshal(yamlSource, &envelope); err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -67,6 +67,8 @@ func (a *AuthOIDC) Configure(yamlSource []byte) (err error) {
|
|||
} `yaml:"providers"`
|
||||
}{}
|
||||
|
||||
envelope.Cookie = plugins.DefaultCookieConfig()
|
||||
|
||||
if err := yaml.Unmarshal(yamlSource, &envelope); err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -45,6 +45,8 @@ func (a *AuthSimple) Configure(yamlSource []byte) error {
|
|||
} `yaml:"providers"`
|
||||
}{}
|
||||
|
||||
envelope.Cookie = plugins.DefaultCookieConfig()
|
||||
|
||||
if err := yaml.Unmarshal(yamlSource, &envelope); err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -44,6 +44,8 @@ func (a *AuthYubikey) Configure(yamlSource []byte) error {
|
|||
} `yaml:"providers"`
|
||||
}{}
|
||||
|
||||
envelope.Cookie = plugins.DefaultCookieConfig()
|
||||
|
||||
if err := yaml.Unmarshal(yamlSource, &envelope); err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -19,3 +19,10 @@ func (c CookieConfig) GetSessionOpts() *sessions.Options {
|
|||
HttpOnly: true,
|
||||
}
|
||||
}
|
||||
|
||||
func DefaultCookieConfig() CookieConfig {
|
||||
return CookieConfig{
|
||||
Prefix: "nginx-sso",
|
||||
Expire: 3600,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue