Commit 09529809 authored by Anuj Gupta's avatar Anuj Gupta
Browse files

Merge branch 'ibm-impl-ci-cd' into 'master'

Ibm impl ci cd

See merge request !14
parents f6a6e37e df921b36
Pipeline #25706 failed with stages
in 13 minutes and 31 seconds
......@@ -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)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment