Moodle

Implement session token for embedded application

Details

  • Type: Sub-task Sub-task
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 2.0
  • Fix Version/s: 2.0
  • Component/s: Web Services
  • Labels:
    None
  • Affected Branches:
    MOODLE_20_STABLE
  • Fixed Branches:
    MOODLE_20_STABLE

Description

We need a way to support embedded application with web service. See use case: http://moodle.org/mod/forum/discuss.php?d=119349
Petr wrote a beginning of specification: http://docs.moodle.org/en/Development:External_services_security#Application_embedding

Activity

Hide
Jerome Mouneyrac added a comment -

I don't know much about it. Petr I assigned this issue to you. I could do it, but I need to know a lot more, don't have a good vision of what to do, how to do, what are the difficulties, ...

Show
Jerome Mouneyrac added a comment - I don't know much about it. Petr I assigned this issue to you. I could do it, but I need to know a lot more, don't have a good vision of what to do, how to do, what are the difficulties, ...
Hide
Jamie Pratt added a comment -

Would like to help with this in anyway I can. Petr is certainly the best placed person to know how this should best be done, but if you want to give me some pointers, Petr, I would be happy to make a patch for review.

Show
Jamie Pratt added a comment - Would like to help with this in anyway I can. Petr is certainly the best placed person to know how this should best be done, but if you want to give me some pointers, Petr, I would be happy to make a patch for review.
Hide
Petr Škoda (skodak) added a comment -

to Martin: we usually do try{} catch {} in corner cases instead of DDL table_exist

Show
Petr Škoda (skodak) added a comment - to Martin: we usually do try{} catch {} in corner cases instead of DDL table_exist
Hide
Jamie Pratt added a comment -

Is the previous comment posted to the wrong issue Petr??

Show
Jamie Pratt added a comment - Is the previous comment posted to the wrong issue Petr??
Hide
Jamie Pratt added a comment -

Committed a fix for this issue to CVS.

Show
Jamie Pratt added a comment - Committed a fix for this issue to CVS.
Hide
Petr Škoda (skodak) added a comment -

I clicked on a MDL- link in commit message, so I guess it is correct

Show
Petr Škoda (skodak) added a comment - I clicked on a MDL- link in commit message, so I guess it is correct
Hide
Eloy Lafuente (stronk7) added a comment -

Uhm... just guessing if this patch is expected to work ok always:

http://cvs.moodle.org/moodle/lib/sessionlib.php?r1=1.48&r2=1.49

As far as I understand the class loading mechanism of DB stuff, the call to get_manager() is the one in charge of including all the DDL stuff (like xmldb_xxxx objects). So we shouldn't be using this:

$table = new xmldb_table('external_tokens');

before the get_manager() call.

Reopening for review, ciao

Show
Eloy Lafuente (stronk7) added a comment - Uhm... just guessing if this patch is expected to work ok always: http://cvs.moodle.org/moodle/lib/sessionlib.php?r1=1.48&r2=1.49 As far as I understand the class loading mechanism of DB stuff, the call to get_manager() is the one in charge of including all the DDL stuff (like xmldb_xxxx objects). So we shouldn't be using this:
$table = new xmldb_table('external_tokens');
before the get_manager() call. Reopening for review, ciao
Hide
Eloy Lafuente (stronk7) added a comment -

Ah, sorry, forget my last comment, I just fetched mail and saw an improved version that uses the get_manager() before anything else.

Re-closing this.. .ciao

Show
Eloy Lafuente (stronk7) added a comment - Ah, sorry, forget my last comment, I just fetched mail and saw an improved version that uses the get_manager() before anything else. Re-closing this.. .ciao
Hide
Jerome Mouneyrac added a comment -

did a quick fix for missing WEBSERVICE_AUTHMETHOD_SESSION_TOKEN (instead EXTERNAL_TOKEN_EMBEDDED)

Show
Jerome Mouneyrac added a comment - did a quick fix for missing WEBSERVICE_AUTHMETHOD_SESSION_TOKEN (instead EXTERNAL_TOKEN_EMBEDDED)
Hide
Jamie Pratt added a comment -

Thanks for catching that Jerome.

Show
Jamie Pratt added a comment - Thanks for catching that Jerome.
Hide
Martin Dougiamas added a comment -

Jamie, Petr was referring to my fix on some of your recent checkin:

http://cvs.moodle.org/moodle/lib/sessionlib.php?r1=1.48&r2=1.50

which he updated with this improved syntax:

http://cvs.moodle.org/moodle/lib/sessionlib.php?r1=1.50&r2=1.51

Show
Martin Dougiamas added a comment - Jamie, Petr was referring to my fix on some of your recent checkin: http://cvs.moodle.org/moodle/lib/sessionlib.php?r1=1.48&r2=1.50 which he updated with this improved syntax: http://cvs.moodle.org/moodle/lib/sessionlib.php?r1=1.50&r2=1.51
Hide
Jerome Mouneyrac added a comment -

did a quick fix for forgotten $this->simple

Show
Jerome Mouneyrac added a comment - did a quick fix for forgotten $this->simple

Dates

  • Created:
    Updated:
    Resolved: