MCPcopy Create free account
hub / github.com/authlib/authlib / get_headers

Method get_headers

authlib/oauth2/rfc6749/errors.py:201–213  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

199 self.realm = realm
200
201 def get_headers(self):
202 headers = super().get_headers()
203 if not self.auth_type:
204 return headers
205
206 extras = []
207 if self.realm:
208 extras.append(f'realm="{self.realm}"')
209 extras.append(f'error="{self.error}"')
210 error_description = self.description
211 extras.append(f'error_description="{error_description}"')
212 headers.append(("WWW-Authenticate", f"{self.auth_type} " + ", ".join(extras)))
213 return headers
214
215
216class MissingAuthorizationError(ForbiddenError):

Callers 1

get_headersMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected