Yes is true for the QString section.
When i'm try connected until build a cookie i have a redirection with the cookie in the url.
https://cas.univ-ubs.fr/login;jsessionid=EC0A6DAAB7A739B99B00B17200346C84" .
When i don't used the cookie i just have a redirection.
In python i just used (HTTPCookieProcessor)
def __init__(self):
self.CJ = CookieJar()
self.connection = build_opener(HTTPCookieProcessor(self.CJ))
def getConnection(self):
try:
u = self.connection.open("https://cas.univ-ubs.fr/login").read()
f = '<input type="hidden" name="lt" value="'
l = u.rfind(f)
r = u.rfind('" />\n\t\t\t\t\t\t<input type="hidden" name="_eventId"')
data = u[l+len(f):r]
params = urlencode({
"username":self.username,
"password":self.password,
"lt":data,
"_eventId":"submit",
"submit":"SE CONNECTER"
})
self.connection.open("https://cas.univ-ubs.fr/login", params)
def __init__(self):
self.CJ = CookieJar()
self.connection = build_opener(HTTPCookieProcessor(self.CJ))
def getConnection(self):
try:
u = self.connection.open("https://cas.univ-ubs.fr/login").read()
f = '<input type="hidden" name="lt" value="'
l = u.rfind(f)
r = u.rfind('" />\n\t\t\t\t\t\t<input type="hidden" name="_eventId"')
data = u[l+len(f):r]
params = urlencode({
"username":self.username,
"password":self.password,
"lt":data,
"_eventId":"submit",
"submit":"SE CONNECTER"
})
self.connection.open("https://cas.univ-ubs.fr/login", params)
To copy to clipboard, switch view to plain text mode
I can't translate perfectly in C++ with Qt but i think is possible to work.
Bookmarks