#3456 closed defect (fixed)
Browse: authenticate with schoolserver
Reported by: | manuq | Owned by: | manuq |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | Browse | Version: | Git as of bugdate |
Severity: | Unspecified | Keywords: | 12.1.0, olpc-test-passed |
Cc: | erikos | Distribution/OS: | Unspecified |
Bug Status: | Unconfirmed |
Description
Create a HTTP Cookie to authenticate with the Schoolserver.
Epiphany is as well using the 'cookies.sqlite' database, we can reuse that, and use libsoup for the management. We get the session with WebKit.get_default_session(), see embed/ephy-embed-single.c and lib/ephy-profile-migrator.c for a migrator.
Attachments (1)
Change History (13)
comment:1 Changed 11 years ago by manuq
comment:2 Changed 11 years ago by manuq
I'm trying to port Epiphany code, but SoupCookieJarSqlite [1] class is not available through Python bindings. I can however see the parent class and the sister class SoupCookieJarText:
from gi.repository import Soup parent = Soup.CookieJar() sister = Soup.CookieJarText('cookies.txt')
[1] http://developer.gnome.org/libsoup/stable/SoupCookieJarSqlite.html
comment:3 Changed 11 years ago by manuq
- Priority changed from Unspecified by Maintainer to Normal
- Status changed from new to accepted
Thanks to Daniel to discover that SoupCookieJarSqlite lives in SoupGNOME.CookieJarSqlite . Sometimes this bindings are not very intuitive.
Sent a patch to the list that adds cookies in Browse persistent between sessions, using the SQlite database that was previously used.
comment:4 Changed 11 years ago by manuq
- Keywords olpc-test-pending added
- Resolution set to fixed
- Status changed from accepted to closed
Commited as f6dd764abd7c160e6188757b8e61cd01062a92c6 .
Let's test with an XS how it behaves.
comment:5 Changed 11 years ago by manuq
- Resolution fixed deleted
- Status changed from closed to reopened
comment:6 Changed 11 years ago by manuq
Reopening after testing with a XS. After registering with a schoolserver Browse does not start. Attaching the traceback.
Changed 11 years ago by manuq
comment:7 Changed 11 years ago by manuq
Seems that we introduced the bug in the JSON API port, 8b7a3b5cebb8ed7ead60841d052c02753d09ac34 -- cjson.encode was accidentally renamed to json.loads instead of json.dumps .
comment:8 Changed 11 years ago by manuq
Also the cookie was being wrongly attached to the backup_uri, making a better uri using the jabber server now. Tested with an XS, it autologins. Also tested that handles jabber server re-registrations. Patch sent to the list.
comment:9 Changed 11 years ago by manuq
Pushed as ccd363c1f70a54ce84468c4e850c867a48b6a99e .
comment:10 Changed 11 years ago by manuq
- Resolution set to fixed
- Status changed from reopened to closed
comment:11 Changed 11 years ago by greenfeld
- Keywords olpc-test-passed added; olpc-test-pending removed
I can login to Moodle on a schoolserver with 12.1.0 os10/Browse-137.
The original code in Browse, that stays intact in webactivity.py, should do the cookie and store it in a 'cookies.sqlite' database, if the setting '/desktop/sugar/backup_url' in gconf is set.