get
method of aioauth.collections.HTTPHeaderDict
class is not case-insensitive
#97
Labels
bug
Something isn't working
Hi
aioauth
Team,The
get
method of the classaioauth.collections.HTTPHeaderDict
is not case-insensitive. Due to this, thecreate_token_response
method of theaioauth.server.AuthorizationServer
is unable to authenticate the client based on theAuthorization
header passed in to the token endpoint (ie. whenever client is authenticate using HTTP basic). The issue is caused indeed because theget
method ofHTTPHeaderDict
is not case-insensitive that makes this following line to retrieve an empty string:aioauth/aioauth/server.py
Line 218 in 7a8ce10
The solution is as easy as override the following methods inherited from
UserDict
when definingHTTPHeaderDict
. This is indeed the patched version ofHTTPHeaderDict
I am using:Expected Result
I was expected the code line above to retrieve the HTTP basic value from
Authorization
header as passed in to the original token request.Actual Result
The code line above results in a empty string.
Reproduction Steps
Authenticate the client using HTTP Basic when calling the token endpoint. For example, like in this pytest function I have in my project where I am using the
starlette.testclient.TestClient
as a test http client:System Information
The text was updated successfully, but these errors were encountered: