Skip to content

Commit

Permalink
Fix "Cannot supply multiple client credentials." error for Okta users (
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtyomVancyan authored Aug 3, 2024
2 parents 1e6d30a + 770d962 commit 53973d6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/fastapi_oauth2/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ async def token_data(self, request: Request, **httpx_client_args) -> dict:
async with httpx.AsyncClient(auth=auth, **httpx_client_args) as session:
try:
response = await session.post(token_url, headers=headers, content=content)
if response.status_code == 401:
content = re.sub(r"client_id=[^&]+", "", content)
response = await session.post(token_url, headers=headers, content=content)
self._oauth_client.parse_request_body_response(json.dumps(response.json()))
return self.standardize(self.backend.user_data(self.access_token))
except (OAuth2Error, httpx.HTTPError) as e:
Expand Down

0 comments on commit 53973d6

Please sign in to comment.