summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Krogh <markus@nordu.net>2018-11-08 13:01:46 +0100
committerMarkus Krogh <markus@nordu.net>2018-11-08 13:01:46 +0100
commit95dd53eaa0f50171c8a6baf30ec591d285072caa (patch)
treecafe57bf41021f7f1e45e12379bbbe3563f3aa7a
parent564baa927dd3d5dddd721bb76c446362c24a8826 (diff)
Add logout url
-rw-r--r--main.go5
-rw-r--r--views.go1
2 files changed, 5 insertions, 1 deletions
diff --git a/main.go b/main.go
index 962c624..6a2ac75 100644
--- a/main.go
+++ b/main.go
@@ -18,6 +18,7 @@ type PwmanServer struct {
ChangePwScript string
RemoteUserHeader string
BasePath string
+ LogoutUrl string
}
var pwman *PwmanServer
@@ -25,7 +26,7 @@ var pwman *PwmanServer
const csrf_base = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789._#%!&:;?+{}[]"
func main() {
- var ldapServer, ldapUser, ldapPassword, pwnedFile, krb5Conf, changePwScript, csrfSecret, serverAddr, basePath string
+ var ldapServer, ldapUser, ldapPassword, pwnedFile, krb5Conf, changePwScript, csrfSecret, serverAddr, basePath, logoutUrl string
var ldapPort int
var ldapSkipSSLVerify, csrfInsecure, gennerateCsrfKey bool
flag.StringVar(&ldapServer, "ldap-server", "localhost", "the ldap server address")
@@ -39,6 +40,7 @@ func main() {
flag.StringVar(&csrfSecret, "csrf-secret", "", "Specify csrf 32 char secret")
flag.StringVar(&serverAddr, "address", ":3000", "Server address to listen on")
flag.StringVar(&basePath, "base-path", "", "A base path that pwman lives under e.g. /sso")
+ flag.StringVar(&logoutUrl, "logout-url", "/Shibboleth.sso/Logout", "The path to use for allowing the user to log out")
flag.BoolVar(&csrfInsecure, "csrf-insecure", false, "Allow csrf cookie to be sent over http")
flag.BoolVar(&gennerateCsrfKey, "gennerate-csrf", false, "Gennerate a csrf secret")
flag.Parse()
@@ -61,6 +63,7 @@ func main() {
ChangePwScript: changePwScript,
RemoteUserHeader: "X-Remote-User",
BasePath: basePath,
+ LogoutUrl: LogoutUrl,
}
v := Views()
diff --git a/views.go b/views.go
index a78f8c8..1f63036 100644
--- a/views.go
+++ b/views.go
@@ -107,6 +107,7 @@ func NewPageCtx(req *http.Request) PageCtx {
"User": user,
"CsrfField": csrf.TemplateField(req),
"BasePath": pwman.BasePath,
+ "LogoutUrl": pwman.LogoutUrl,
}
}