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

Function FetchMetadata

samlsp/fetch_metadata.go:265–271  ·  view source on GitHub ↗

FetchMetadata returns metadata from an IDP metadata URL. If httpClient is nil, a client with a two-minute timeout is used. Only a 2xx response is accepted. The metadata names the certificates the service provider trusts to sign assertions, so whoever controls the response controls who can log in.

(ctx context.Context, httpClient *http.Client, metadataURL url.URL)

Source from the content-addressed store, hash-verified

263// is not authenticated beyond what httpClient does: use an https URL, and
264// prefer FetchSignedMetadata, or metadata kept with the application.
265func FetchMetadata(ctx context.Context, httpClient *http.Client, metadataURL url.URL) (*saml.EntityDescriptor, error) {
266 data, err := fetchMetadataBytes(ctx, httpClient, metadataURL)
267 if err != nil {
268 return nil, err
269 }
270 return ParseMetadata(data)
271}
272
273// FetchMetadataByEntityID fetches metadata from metadataURL and returns the
274// entity whose entityID is entityID. Use it to select an IDP from aggregate

Calls 2

fetchMetadataBytesFunction · 0.85
ParseMetadataFunction · 0.85