Skip to content

Commit 0640065

Browse files
committed
SAML post to correct URL and make example run locally
1 parent 4664c86 commit 0640065

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

example/service.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ OwJlNCASPZRH/JmF8tX0hoHuAQ==
121121
)
122122

123123
func main() {
124-
rootURLstr := flag.String("url", "https://962766ce.ngrok.io", "The base URL of this service")
125-
idpMetadataURLstr := flag.String("idp", "https://516becc2.ngrok.io/metadata", "The metadata URL for the IDP")
124+
rootURLstr := flag.String("url", "http://localhost:8090", "The base URL of this service")
125+
idpMetadataURLstr := flag.String("idp", "http://localhost:8080/metadata", "The metadata URL for the IDP")
126126
flag.Parse()
127127

128128
keyPair, err := tls.X509KeyPair(cert, key)
@@ -175,11 +175,11 @@ func main() {
175175
}
176176

177177
mux := http.NewServeMux()
178-
mux.Handle("GET /saml/", samlSP)
179-
mux.HandleFunc("GET /{link}", ServeLink)
178+
mux.Handle("/saml/", samlSP)
179+
mux.HandleFunc("GET /links/{link}", ServeLink)
180180
mux.Handle("GET /whoami", samlSP.RequireAccount(http.HandlerFunc(ServeWhoami)))
181-
mux.Handle("POST /", samlSP.RequireAccount(http.HandlerFunc(CreateLink)))
182-
mux.Handle("GET /", samlSP.RequireAccount(http.HandlerFunc(ListLinks)))
181+
mux.Handle("POST /links", samlSP.RequireAccount(http.HandlerFunc(CreateLink)))
182+
mux.Handle("GET /links", samlSP.RequireAccount(http.HandlerFunc(ListLinks)))
183183

184-
http.ListenAndServe(":8080", mux)
184+
http.ListenAndServe(":8090", mux)
185185
}

samlidp/session.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ func (s *Server) sendLoginForm(w http.ResponseWriter, req *saml.IdpAuthnRequest,
129129
RelayState string
130130
}{
131131
Toast: toast,
132-
URL: req.IDP.LoginURL.String(),
132+
URL: req.IDP.SSOURL.String(),
133133
SAMLRequest: base64.StdEncoding.EncodeToString(req.RequestBuffer),
134134
RelayState: req.RelayState,
135135
}

0 commit comments

Comments
 (0)