Last active
October 4, 2019 15:04
-
-
Save iarenaza/0a87b35935e6d217eb714affe6c5e154 to your computer and use it in GitHub Desktop.
testkeycloak.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# You need to install python-keycloak for this to work. Do: | |
# | |
# pip install python-keycloak | |
# | |
# first | |
from keycloak import KeycloakOpenID | |
keycloak_openid = KeycloakOpenID(server_url="https://xxxxx.yyyyy/auth/", | |
client_id="xxxx-xxxx-xxxx", | |
realm_name="yyyyyyyy") | |
token = keycloak_openid.token("username", "password", scope="openid email") | |
id_token = token['id_token'] | |
print(id_token) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment