Skip to content
Snippets Groups Projects
Commit 655b0a9f authored by ale's avatar ale
Browse files

Fix callers of SSOWrapper

parent 42482e82
Branches
Tags
1 merge request!6Refactor the login handler
...@@ -19,6 +19,9 @@ import ( ...@@ -19,6 +19,9 @@ import (
"git.autistici.org/id/go-sso/httpsso" "git.autistici.org/id/go-sso/httpsso"
) )
// TTL for SSO sessions on the proxy.
var proxyAuthTTL = 1 * time.Hour
// RNG for the random backend selector. // RNG for the random backend selector.
var rnd = rand.New(rand.NewSource(time.Now().UnixNano())) var rnd = rand.New(rand.NewSource(time.Now().UnixNano()))
...@@ -131,6 +134,7 @@ func NewProxy(config *Config) (http.Handler, error) { ...@@ -131,6 +134,7 @@ func NewProxy(config *Config) (http.Handler, error) {
config.SSODomain, config.SSODomain,
[]byte(config.SessionAuthKey), []byte(config.SessionAuthKey),
[]byte(config.SessionEncKey), []byte(config.SessionEncKey),
proxyAuthTTL,
) )
if err != nil { if err != nil {
return nil, err return nil, err
......
...@@ -26,6 +26,9 @@ import ( ...@@ -26,6 +26,9 @@ import (
"git.autistici.org/id/go-sso/httpsso" "git.autistici.org/id/go-sso/httpsso"
) )
// Lifetime of an authenticated session.
var samlAuthTTL = 1 * time.Hour
type serviceProvider struct { type serviceProvider struct {
// Descriptor can either be an inline XML document, or it can // Descriptor can either be an inline XML document, or it can
// be read from a file with the syntax "@filename". // be read from a file with the syntax "@filename".
...@@ -229,7 +232,7 @@ func NewSAMLIDP(config *Config) (http.Handler, error) { ...@@ -229,7 +232,7 @@ func NewSAMLIDP(config *Config) (http.Handler, error) {
return nil, err return nil, err
} }
w, err := httpsso.NewSSOWrapper(config.SSOLoginServerURL, pkey, config.SSODomain, []byte(config.SessionAuthKey), []byte(config.SessionEncKey)) w, err := httpsso.NewSSOWrapper(config.SSOLoginServerURL, pkey, config.SSODomain, []byte(config.SessionAuthKey), []byte(config.SessionEncKey), samlAuthTTL)
if err != nil { if err != nil {
return nil, err return nil, err
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment