Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion httpx_auth/_oauth2/client_credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
from typing import Union, Iterable

import httpx
import urllib.parse

from httpx_auth._authentication import SupportMultiAuth
from httpx_auth._oauth2.common import (
OAuth2BaseAuth,
Expand Down Expand Up @@ -97,7 +99,10 @@ def request_new_token(self) -> tuple:
return (self.state, token, expires_in) if expires_in else (self.state, token)

def _configure_client(self, client: httpx.Client):
client.auth = (self.client_id, self.client_secret)
encoded_client = urllib.parse.quote(self.client_id, safe="")
encoded_secret = urllib.parse.quote(self.client_secret, safe="")

client.auth = (encoded_client, encoded_secret)
client.timeout = self.timeout


Expand Down