Forum LAMS for Tech-Heads - General Forum: Re: Re: Re: Integration - Single sign on questions


 
Search: 

4: Re: Re: Re: Integration - Single sign on questions
In response to 3 11/16/05 04:32 AM
[ Reply | Forward ]
This looks great Enrie thanks,

Apurva and I are still a bit unsure of the hash value and how to create it.

-- "The hash is what LAMS uses for authenticating the user and verifying that he/she is coming from the right place. (this is the single sign-on mechanism we use" --

How do we construct the hash? We've tried generating our own and also looking at the Moodle integration code but its not very clear.

-- from the moodle/lams code
$plaintext = trim($datetime).trim($USER->username).trim
($CONSTANTS->author_method).trim($CFG->lams_serverid).trim($CFG->lams_serverkey);

$hash = sha1(strtolower($plaintext));

It appears to be the concatenation of: the datetime, username, author method??(what is this?), the server id and the server key.

Then the result is converted to lowercase and the sha hash function performed on it.

Most of the values appear to be ok, the one that doesn't make sense is the author_method.

Thanks for you quick response,
Scott.

Posted by Scott Bradley

5: Re: Re: Re: Re: Integration - Single sign on questions
In response to 4 11/16/05 04:35 AM
[ Reply | Forward ]
Also,

Do we need to apply for the server key and the server id? In the Moodle configuration file it appears like we have to apply for them. Is this correct?


$string['serverid'] = 'Enter the server ID received from LAMS international.';
$string['serverkey'] = 'Enter the server key received from LAMS international.';


s.

Posted by Scott Bradley

6: Re: Re: Re: Re: Re: Integration - Single sign on questions
In response to 5 11/16/05 07:06 PM
[ Reply | Forward ]
That must be a mistake from when the module was being tested, you don't need LI to give you an ID/key - feel free to use whatever suits you. It just needs to match the ID/key stored in LAMS' external server table.

Also, the author_method in the hash is referring to whether that particular hash is for author/monitor/learner, in this case author. Maybe someone else could shed some light on why this is.

Posted by Jun-Dir Liew

7: Re: Re: Re: Re: Integration - Single sign on questions
In response to 4 11/17/05 01:32 AM
[ Reply | Forward ]
> author method??(what is this?)

As Jun-Dir mentions, it is actually a string containing "author" "monitor" or "learner" according to the module you are about to access in LAMS.

Posted by Ernie Ghiglione

Reply to first post on this page
Back to LAMS for Tech-Heads - General Forum