User by session key

User by session key

by Nahum Lipkunsky -
Number of replies: 3

How do I find out who is the user logged in for a session key ? 

Is it possible via web service API ? 


Thanks

Average of ratings: -
In reply to Nahum Lipkunsky

Re: User by session key

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Why? What is it you are trying to do?

In reply to Howard Miller

Re: User by session key

by Nahum Lipkunsky -

I need to establish trust between the logged in Moodle user to some other system the user is directed to via a url generated on the Moodle side. 

My thinking is to pass the session key as a parameter and do back validation it via web-api call.



 

In reply to Nahum Lipkunsky

Re: User by session key

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

I would suggest that is not the way to do it. 

Build a two-way web service, redirect to Moodle and pass a one-time token or similar. The Moodle session cookies don't hold anything terribly useful so you'll have big problems doing it your way. 

Or possibly use a standard authentication mechanism but those are often total overkill.