Ticket #3456 (closed defect: fixed)

Opened 13 months ago

Last modified 12 months ago

Browse: authenticate with schoolserver

Reported by: manuq Owned by: manuq
Priority: Normal Milestone: 0.96
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

xs-error.log Download (1.1 KB) - added by manuq 13 months ago.

Change History

Changed 13 months ago by manuq

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.

Changed 13 months 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

Changed 13 months 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.

Changed 13 months ago by manuq

  • keywords 12.1.0, olpc-test-pending added; 12.1.0 removed
  • status changed from accepted to closed
  • resolution set to fixed

Commited as f6dd764abd7c160e6188757b8e61cd01062a92c6 .

Let's test with an XS how it behaves.

Changed 13 months ago by manuq

  • status changed from closed to reopened
  • resolution fixed deleted

Changed 13 months ago by manuq

Reopening after testing with a XS. After registering with a schoolserver Browse does not start. Attaching the traceback.

Changed 13 months ago by manuq

Changed 13 months 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 .

Changed 13 months 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.

Changed 13 months ago by manuq

Pushed as ccd363c1f70a54ce84468c4e850c867a48b6a99e .

Changed 13 months ago by manuq

  • status changed from reopened to closed
  • resolution set to fixed

Changed 12 months 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.

Note: See TracTickets for help on using tickets.