Skip to content

Commit

Permalink
idp: fix crewjam#507
Browse files Browse the repository at this point in the history
Options.URL must NOT have a trailing slash
otherwise the form will post to //sso which gets redirected to /sso without reposting the data
  • Loading branch information
aep committed Mar 19, 2023
1 parent 2aeb2ef commit 41509da
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions samlidp/samlidp.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"net/url"
"regexp"
"sync"
"strings"

"github.com/zenazn/goji/web"

Expand Down Expand Up @@ -46,6 +47,9 @@ type Server struct {

// New returns a new Server
func New(opts Options) (*Server, error) {
if strings.HasSuffix(opts.URL.Path, "/") {
opts.URL.Path = opts.URL.Path[:len(opts.URL.Path)-1]
}
metadataURL := opts.URL
metadataURL.Path = metadataURL.Path + "/metadata"
ssoURL := opts.URL
Expand Down

0 comments on commit 41509da

Please sign in to comment.