Skip to content

Commit

Permalink
fix login form being submitted to /sso instead of /login
Browse files Browse the repository at this point in the history
  • Loading branch information
rubensayshi committed May 17, 2024
1 parent a32b643 commit e8670d7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions identity_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ type IdentityProvider struct {
Intermediates []*x509.Certificate
MetadataURL url.URL
SSOURL url.URL
LoginURL url.URL
LogoutURL url.URL
ServiceProviderProvider ServiceProviderProvider
SessionProvider SessionProvider
Expand Down
3 changes: 3 additions & 0 deletions samlidp/samlidp.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ func New(opts Options) (*Server, error) {
metadataURL.Path += "/metadata"
ssoURL := opts.URL
ssoURL.Path += "/sso"
loginURL := opts.URL
loginURL.Path += "/login"
logr := opts.Logger
if logr == nil {
logr = logger.DefaultLogger
Expand All @@ -65,6 +67,7 @@ func New(opts Options) (*Server, error) {
Certificate: opts.Certificate,
MetadataURL: metadataURL,
SSOURL: ssoURL,
LoginURL: loginURL,
},
logger: logr,
Store: opts.Store,
Expand Down
2 changes: 1 addition & 1 deletion samlidp/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func (s *Server) sendLoginForm(w http.ResponseWriter, _ *http.Request, req *saml
RelayState string
}{
Toast: toast,
URL: req.IDP.SSOURL.String(),
URL: req.IDP.LoginURL.String(),
SAMLRequest: base64.StdEncoding.EncodeToString(req.RequestBuffer),
RelayState: req.RelayState,
}
Expand Down

0 comments on commit e8670d7

Please sign in to comment.