Skip to content

Commit

Permalink
Fixed auth.
Browse files Browse the repository at this point in the history
  • Loading branch information
Knucklessg1 committed May 9, 2024
1 parent 3432656 commit 413673b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions servicenow_api/servicenow_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,7 @@ def __init__(
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)

if username and password and client_id and client_secret:
auth_headers = {
"Content-Type": "application/x-www-form-urlencoded"
}
auth_headers = {"Content-Type": "application/x-www-form-urlencoded"}
auth_data = {
"grant_type": grant_type,
"client_id": client_id,
Expand All @@ -91,7 +89,7 @@ def __init__(
response = response.json()
except Exception as e:
print(f"Error Authenticating with OAuth: \n\n{e}")
raise AuthError
raise e
self.headers = {
"Authorization": f'Bearer {response["access_token"]}',
"Content-Type": "application/json",
Expand Down
2 changes: 1 addition & 1 deletion servicenow_api/version.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python
# coding: utf-8

__version__ = '0.20.16'
__version__ = "0.20.16"
__author__ = "Audel Rouhi"
__credits__ = "Audel Rouhi"

0 comments on commit 413673b

Please sign in to comment.