Created
March 8, 2017 18:16
-
-
Save tecoholic/506388bc2a2c5fce03a9a275e54ba766 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
from oxdpython import Client | |
client = Client("/location/to/conf") | |
client.register_site() | |
auth_url = client.get_authorization_url() | |
# code = parse_callback_url_querystring() # Refer your web framework | |
# state = parse_callback_url_querystring() # Refer your web framework | |
tokens = client.get_tokens_by_code(code, state) | |
user = client.get_user_info(tokens.access_token) | |
# The claims can be accessed using the dot notation. | |
print user.username | |
print user.website |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment