MCPcopy Create free account
hub / github.com/crewjam/saml / ServeHTTP

Method ServeHTTP

samlsp/middleware.go:53–65  ·  view source on GitHub ↗

ServeHTTP implements http.Handler and serves the SAML-specific HTTP endpoints on the URIs specified by m.ServiceProvider.MetadataURL and m.ServiceProvider.AcsURL.

(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

51// on the URIs specified by m.ServiceProvider.MetadataURL and
52// m.ServiceProvider.AcsURL.
53func (m *Middleware) ServeHTTP(w http.ResponseWriter, r *http.Request) {
54 if r.URL.Path == m.ServiceProvider.MetadataURL.Path {
55 m.ServeMetadata(w, r)
56 return
57 }
58
59 if r.URL.Path == m.ServiceProvider.AcsURL.Path {
60 m.ServeACS(w, r)
61 return
62 }
63
64 http.NotFoundHandler().ServeHTTP(w, r)
65}
66
67// ServeMetadata handles requests for the SAML metadata endpoint.
68func (m *Middleware) ServeMetadata(w http.ResponseWriter, r *http.Request) {

Calls 2

ServeMetadataMethod · 0.95
ServeACSMethod · 0.95