Skip to content
Snippets Groups Projects
Commit 3badc383 authored by ale's avatar ale
Browse files

Modify the SSO URL to /login

parent 8d9e7f2b
Branches
No related tags found
No related merge requests found
...@@ -232,9 +232,9 @@ func NewSAMLIDP(config *Config) (http.Handler, error) { ...@@ -232,9 +232,9 @@ func NewSAMLIDP(config *Config) (http.Handler, error) {
if err != nil { if err != nil {
return nil, err return nil, err
} }
ssoURL := baseURL ssoURL := *baseURL
ssoURL.Path += "/sso" ssoURL.Path += "/login"
metadataURL := baseURL metadataURL := *baseURL
metadataURL.Path += "/metadata" metadataURL.Path += "/metadata"
svc := fmt.Sprintf("%s%s", baseURL.Host, baseURL.Path) svc := fmt.Sprintf("%s%s", baseURL.Host, baseURL.Path)
if !strings.HasSuffix(svc, "/") { if !strings.HasSuffix(svc, "/") {
...@@ -246,11 +246,15 @@ func NewSAMLIDP(config *Config) (http.Handler, error) { ...@@ -246,11 +246,15 @@ func NewSAMLIDP(config *Config) (http.Handler, error) {
return nil, err return nil, err
} }
// Create the SAML IdentityProvider, but then we put another
// mux.Router in front in order to wrap just the ssoURL with
// our own SSO handler.
idp := &saml.IdentityProvider{ idp := &saml.IdentityProvider{
Key: cert.PrivateKey, Key: cert.PrivateKey,
Certificate: cert.Leaf, Certificate: cert.Leaf,
Logger: logger.DefaultLogger, Logger: logger.DefaultLogger,
SSOURL: *ssoURL, MetadataURL: metadataURL,
SSOURL: ssoURL,
ServiceProviderProvider: config, ServiceProviderProvider: config,
SessionProvider: users, SessionProvider: users,
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment