@@ -30,6 +30,10 @@ def __init__(
3030 self .oauth_callback_route_name = oauth_callback_route_name
3131 self .default_scopes = default_scopes
3232
33+ self .request_headers = {
34+ 'Accept' : 'application/json' ,
35+ }
36+
3337 async def get_authorization_url (
3438 self ,
3539 redirect_uri : str ,
@@ -86,7 +90,11 @@ async def get_access_token(self, code: str, redirect_uri: str, code_verifier: st
8690 if code_verifier :
8791 data .update ({'code_verifier' : code_verifier })
8892 async with httpx .AsyncClient () as client :
89- response = await client .post (self .access_token_endpoint , data = data )
93+ response = await client .post (
94+ self .access_token_endpoint ,
95+ data = data ,
96+ headers = self .request_headers ,
97+ )
9098 await self .raise_httpx_oauth20_errors (response )
9199
92100 res = response .json ()
@@ -104,7 +112,11 @@ async def refresh_token(self, refresh_token: str) -> dict:
104112 'grant_type' : 'refresh_token' ,
105113 }
106114 async with httpx .AsyncClient () as client :
107- response = await client .post (self .refresh_token_endpoint , data = data )
115+ response = await client .post (
116+ self .refresh_token_endpoint ,
117+ data = data ,
118+ headers = self .request_headers ,
119+ )
108120 await self .raise_httpx_oauth20_errors (response )
109121
110122 res = response .json ()
@@ -122,7 +134,11 @@ async def revoke_token(self, token: str, token_type_hint: str | None = None) ->
122134 if token_type_hint is not None :
123135 data .update ({'token_type_hint' : token_type_hint })
124136
125- response = await client .post (self .revoke_token_endpoint , data = data )
137+ response = await client .post (
138+ self .revoke_token_endpoint ,
139+ data = data ,
140+ headers = self .request_headers ,
141+ )
126142
127143 await self .raise_httpx_oauth20_errors (response )
128144
0 commit comments