We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f78ff73 commit 89fe312Copy full SHA for 89fe312
sdcclient/ibm_auth_helper.py
@@ -1,4 +1,7 @@
1
-class IbmAuthHelper():
+import requests
2
+
3
4
+class IbmAuthHelper:
5
'''Authenticate with IBM Cloud IAM.
6
7
**Arguments**
@@ -14,8 +17,8 @@ class IbmAuthHelper():
14
17
def get_headers(url, apikey, guid):
15
18
iam_token = IbmAuthHelper.__get_iam_token(url, apikey)
16
19
return {
- 'Authorization': 'Bearer ' + iam_token,
- 'IBMInstanceID': guid
20
+ 'Authorization': 'Bearer ' + iam_token,
21
+ 'IBMInstanceID': guid
22
}
23
24
@staticmethod
@@ -32,7 +35,7 @@ def __get_iam_endpoint(url):
32
35
33
36
def __get_iam_token(url, apikey):
34
37
env_url = IbmAuthHelper.__get_iam_endpoint(url)
- response = self.http.post(
38
+ response = requests.post(
39
'https://' + env_url + '/identity/token',
40
data={
41
'grant_type': 'urn:ibm:params:oauth:grant-type:apikey',
0 commit comments