Hello,
Please use the following:
1234567 | curl \ -d 'client_id=CLOUDFERRO_PUBLIC' \ -d 'username=YOUR_USERNAME' \ -d 'password=YOUR_PASSWORD' \ -d 'grant_type=password' \ 'https://auth.creodias.eu/auth/realms/DIAS/protocol/openid-connect/token' \ | python -m json.tool |
or this (Python):
123456789101112131415161718 | import requests import json
def get_keycloak_token(): h = { 'Content-Type': 'application/x-www-form-urlencoded' } d = { 'client_id': 'CLOUDFERRO_PUBLIC', 'password': 'YOUR_PASSWORD', 'username': 'YOUR_USERNAME', 'grant_type': 'password' } resp = requests.post('https://auth.creodias.eu/auth/realms/dias/protocol/openid-connect/token', data=d, headers=h) return json.loads(resp.content.decode('utf-8'))['access_token']
if __name__ == "__main__": print (get_keycloak_token()) |
Regards,
Marcin Gil