Skip to content
Snippets Groups Projects
Commit 9da24346 authored by Zhao, Qin's avatar Zhao, Qin
Browse files

corrected login method via TU-ID according to new SSO login page.

parent 56dfb11e
No related branches found
No related tags found
No related merge requests found
......@@ -59,9 +59,11 @@ def loginViaTUID(tuid, password):
#-------------post login data-----------------------
soup = BeautifulSoup(res2.text, "lxml")
value = soup.find('input', {'name':'execution'}).get('value')
logindata = {"username":tuid,"password":password,"execution":value, "_eventId":"submit"}
r3 = session.post(config.sso_url + '/login', cookies = jar, data = logindata)
value = soup.find('input', {'name':'csrf_token'}).get('value')
logindata = {"j_username":tuid,"j_password":password,"csrf_token":value, "_eventId_proceed":"submit"}
r3 = session.post(config.sso_url + '/idp/profile/SAML2/Redirect/SSO?execution=e1s1', cookies = jar, data = logindata)
#----if there is e1s2 ?#
#----------post saml response to tudatalib-----------------------
soup = BeautifulSoup(r3.text, "lxml")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment