Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upClient: Raise error from OAuth 2.0 Bearer errors in WWW-Authenticate #602
Comments
Your suggestion sounds pretty good! Could you do a PR for that ? |
@xmedeko Ping? |
I am not so proficient with Python and currently have no time to dive into it. So, if anyone wants to take up the glove and make PR then I'd be happy to CR and test it. |
Describe the feature
I use requests-oauth to issue requests to a service. If service detects invalid token, it responds with HTTP 401 and header
WWW-Authenticate: Bearer error="invalid_token", error_description="The access token expired"
I got the response and have to parse it by myself. I would like the oauthlib to fail with
InvalidTokenError
instead. (And similarly for other bearer errors in WWW-Authenticate).See also:
Additional context
OAuth 2.0 client