Opened 12 years ago

Closed 12 years ago

Last modified 11 years ago

#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)

xs-error.log (1.1 KB) - added by manuq 12 years ago.

Download all attachments as: .zip

Change History (13)

comment:1 Changed 12 years 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.

comment:2 Changed 12 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 12 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 12 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 12 years ago by manuq

  • Resolution fixed deleted
  • Status changed from closed to reopened

comment:6 Changed 12 years ago by manuq

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

Changed 12 years ago by manuq

comment:7 Changed 12 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 12 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 12 years ago by manuq

Pushed as ccd363c1f70a54ce84468c4e850c867a48b6a99e .

comment:10 Changed 12 years ago by manuq

  • Resolution set to fixed
  • Status changed from reopened to closed

comment:11 Changed 12 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.

comment:12 Changed 11 years ago by dnarvaez

  • Milestone 0.96 deleted

Milestone 0.96 deleted

Note: See TracTickets for help on using tickets.