Skip to content

Commit

Permalink
Issue ref delta-io#269: OAuth 2.0 Credential Format for Delta Sharing…
Browse files Browse the repository at this point in the history
… Python Client Pull Request

Signed-off-by: Dima Alberg <[email protected]>
  • Loading branch information
dialberg committed May 24, 2023
1 parent 467494a commit 516c5b1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions python/delta_sharing/rest_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ def _auth_persistent_oauth2(self, profile):
headers=headers,
auth=(profile.client_id,
profile.client_secret),)

bearer_token = "{}".format(response.json()["access_token"])

self._session.headers.update(
Expand All @@ -191,9 +192,10 @@ def _auth_persistent_oauth2(self, profile):
)

def _auth_basic(self, profile):
response = requests.post(profile.endpoint,
data={"grant_type": "client_credentials"},
auth=(profile.username, profile.password),)
self._session.auth = (profile.username, profile.password)

response = self._session.post(profile.endpoint,
data={"grant_type": "client_credentials"},)

self._session.headers.update(
{
Expand Down

0 comments on commit 516c5b1

Please sign in to comment.