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)
| 51 | // on the URIs specified by m.ServiceProvider.MetadataURL and |
| 52 | // m.ServiceProvider.AcsURL. |
| 53 | func (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. |
| 68 | func (m *Middleware) ServeMetadata(w http.ResponseWriter, r *http.Request) { |