Skip to content
This repository has been archived by the owner on Nov 5, 2019. It is now read-only.

Commit

Permalink
Merge pull request #133 from RandomInsano/patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanielmanistaatgoogle committed Feb 16, 2015
2 parents b29c1bc + 7be6069 commit 3c02a81
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions samples/oauth2_for_devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@
# Step 1: get user code and verification URL
# https://developers.google.com/accounts/docs/OAuth2ForDevices#obtainingacode
flow_info = flow.step1_get_device_and_user_codes()
print "Enter the following code at %s: %s" % (flow_info.verification_url,
flow_info.user_code)
print "Then press Enter."
print("Enter the following code at {0}: {1}".format(flow_info.verification_url,
flow_info.user_code))
print("Then press Enter.")
input()

# Step 2: get credentials
# https://developers.google.com/accounts/docs/OAuth2ForDevices#obtainingatoken
credentials = flow.step2_exchange(device_flow_info=flow_info)
print "Access token:", credentials.access_token
print "Refresh token:", credentials.refresh_token
print("Access token: {0}".format(credentials.access_token))
print("Refresh token: {0}".format(credentials.refresh_token))

# Get YouTube service
# https://developers.google.com/accounts/docs/OAuth2ForDevices#callinganapi
Expand Down

0 comments on commit 3c02a81

Please sign in to comment.