(self)
| 97 | status_code = 400 |
| 98 | |
| 99 | def get_headers(self): |
| 100 | headers = super().get_headers() |
| 101 | if self.status_code == 401: |
| 102 | error_description = self.get_error_description() |
| 103 | # safe escape |
| 104 | error_description = error_description.replace('"', "|") |
| 105 | extras = [ |
| 106 | f'error="{self.error}"', |
| 107 | f'error_description="{error_description}"', |
| 108 | ] |
| 109 | headers.append(("WWW-Authenticate", "Basic " + ", ".join(extras))) |
| 110 | return headers |
| 111 | |
| 112 | |
| 113 | class InvalidGrantError(OAuth2Error): |
nothing calls this directly
no test coverage detected