Skip to content

Instantly share code, notes, and snippets.

@tecoholic
Created March 8, 2017 18:16
Show Gist options
  • Save tecoholic/506388bc2a2c5fce03a9a275e54ba766 to your computer and use it in GitHub Desktop.
Save tecoholic/506388bc2a2c5fce03a9a275e54ba766 to your computer and use it in GitHub Desktop.
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