Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import datetime
import ox3apiclient
# User credentials
email_address = ''
password = ''
# OAuth credentials. These will be supplied by your Account Manager or Support.
domain = ''
realm = ''
consumer_key = ''
consumer_secret = ''
ox = ox3apiclient.OX3APIClient(domain, realm, consumer_key, consumer_secret)
# Step 1. Fetch temporary request token.
ox.fetch_request_token()
# Step 2. Log in to SSO server and authorize token.
ox.authorize_token(email_address, password)
# Step 3. Swap temporary request token for permanent access token.
# If you need to store the access token yourself you can do so with something
# similar to:
# token_str = ox.fetch_access_token()
# access_token = urlparse.parse_qs(token_str)['oauth_token'][0]
ox.fetch_access_token()
# Step 4. Validate your access token.
# You'll more than likely want to call the validate_session method, but you can