fixed links

This commit is contained in:
Rushil Umaretiya 2020-06-14 14:21:33 -04:00
parent f77452c59d
commit 591af545ef

View File

@ -17,7 +17,7 @@ import argparse
client_id = r'QeZPBSKqdvWFfBv1VYTSv9iFGz5T9pVJtNUjbEr6' client_id = r'QeZPBSKqdvWFfBv1VYTSv9iFGz5T9pVJtNUjbEr6'
client_secret = r'0Wl3hAIGY9SvYOqTOLUiLNYa4OlCgZYdno9ZbcgCT7RGQ8x2f1l2HzZHsQ7ijC74A0mrOhhCVeZugqAmOADHIv5fHxaa7GqFNtQr11HX9ySTw3DscKsphCVi5P71mlGY' client_secret = r'0Wl3hAIGY9SvYOqTOLUiLNYa4OlCgZYdno9ZbcgCT7RGQ8x2f1l2HzZHsQ7ijC74A0mrOhhCVeZugqAmOADHIv5fHxaa7GqFNtQr11HX9ySTw3DscKsphCVi5P71mlGY'
redirect_uri = 'http://localhost:8000/' redirect_uri = 'http://localhost:8000/callback/'
token_url = 'https://ion.tjhsst.edu/oauth/token/' token_url = 'https://ion.tjhsst.edu/oauth/token/'
scope = ["read"] scope = ["read"]
@ -49,10 +49,11 @@ def authenticate():
#Linux: chromdriver-linux #Linux: chromdriver-linux
#Macos: chromdriver-mac #Macos: chromdriver-mac
#Windows: chromdriver.exe #Windows: chromdriver.exe
path = os.path.join(cdir, "chromedriver-mac") #path = os.path.join(cdir, "chromedriver-linux")
print(path) #print(path)
browser = webdriver.Chrome(path) #browser = webdriver.Chrome(path)
browser = webdriver.Safari() browser = webdriver.Chrome()
#browser = webdriver.Safari()
web_dir = os.path.join(os.path.dirname(__file__), 'oauth') web_dir = os.path.join(os.path.dirname(__file__), 'oauth')
os.chdir(web_dir) os.chdir(web_dir)
@ -72,11 +73,11 @@ def authenticate():
browser.get("localhost:8000/") browser.get("localhost:8000/")
while "http://localhost:8000/?code" not in browser.current_url: while "http://localhost:8000/callback/?code" not in browser.current_url:
time.sleep(0.25) time.sleep(0.25)
url = browser.current_url url = browser.current_url
gets = url_decode(url.replace("http://localhost:8000/?", "")) gets = url_decode(url.replace("http://localhost:8000/callback/?", ""))
code = gets.get("code") code = gets.get("code")
if state == gets.get("state"): if state == gets.get("state"):
state = gets.get("state") state = gets.get("state")