Skip to content
Snippets Groups Projects
Commit df921b36 authored by Anuj Gupta's avatar Anuj Gupta
Browse files

Ibm impl ci cd

parent f6a6e37e
No related branches found
No related tags found
1 merge request!14Ibm impl ci cd
......@@ -15,6 +15,7 @@ variables:
GCP_SERVICE: seismic-store-service
GCP_VENDOR: gcp
#ibm variables
IBM: 'true'
IBM_OPENSHIFT_PROJECT: og-cicd
IBM_VENDOR: ibm
......
import os
import requests
import json
url = os.getenv('KEYCLOAK_URL')
client_id = os.getenv('KEYCLOAK_CLIENT_ID')
client_secret = os.getenv('KEYCLOAK_CLIENT_SECRET')
user = os.getenv('AUTH_USER_ACCESS')
password = os.getenv('AUTH_USER_ACCESS_PASSWORD')
payload = "grant_type=password&client_id="+client_id+"&client_secret="+client_secret+"&username="+user+"&password="+password+"&scope=openid"
headers = {
'Content-Type': "application/x-www-form-urlencoded"
}
full_url="https://"+url+"/auth/realms/OSDU/protocol/openid-connect/token"
response = requests.request("POST", full_url, data=payload, headers=headers)
print(response.text)
result = response.json()
token = result['access_token']
print(token)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment