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

Merge branch 'impl-ibm-cicd' into 'master'

Impl ibm cicd - add INT tests

See merge request !31
parents 601c00f9 fab5b6b8
Pipeline #29707 failed
......@@ -18,6 +18,8 @@ variables:
OSDU_GCP_APPLICATION_NAME: wellbore-ddms
OSDU_GCP_VENDOR: gcp
IBM_INT_TEST_PY_SUBDIR: tests/integration
include:
- project: "osdu/platform/ci-cd-pipelines"
file: "standard-setup.yml"
......
import os
import requests
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)
result = response.json()
token = result['access_token']
print(token)
Markdown is supported
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