MCPcopy Create free account
hub / github.com/modelcontextprotocol/go-sdk / errorFromChallenges

Function errorFromChallenges

auth/authorization_code.go:312–319  ·  view source on GitHub ↗

errorFromChallenges returns the error from the given "WWW-Authenticate" header challenges. It only looks at challenges with the "Bearer" scheme.

(cs []oauthex.Challenge)

Source from the content-addressed store, hash-verified

310// errorFromChallenges returns the error from the given "WWW-Authenticate" header challenges.
311// It only looks at challenges with the "Bearer" scheme.
312func errorFromChallenges(cs []oauthex.Challenge) string {
313 for _, c := range cs {
314 if c.Scheme == "bearer" && c.Params["error"] != "" {
315 return c.Params["error"]
316 }
317 }
318 return ""
319}
320
321// getProtectedResourceMetadata returns the protected resource metadata.
322// If no metadata was found or the fetched metadata fails security checks,

Callers 1

AuthorizeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…