Get user token in SSO environment

Get user token in SSO environment

by JF Bill -
Number of replies: 2

HI,

I see a lot of post of people asking to use Web Services with an SSO auth plugin, but... no answers... 

In order to use a web service, we need to provide a token which can be obtain when providing username and password:

moodle/login/token.php?username=USERNAME&password=PASSWORD&service=SERVICE

Since there is no password in moodle database when using SSO, how can we get a token ??


We upgraded to moodle 3.4 to have the mobile moodle additionnal features, which is fine, I can define like typeoflogin to present an "in app" webview with the predefined login url.

How to intergrate all of that in an external native application that's needs fetching user authenticated data ?


Thank you 




Average of ratings: -
In reply to JF Bill

Re: Get user token in SSO environment

by Eric Breton -

This questions is verty pertinent to us, if someone could add their input, or links to possible solutions, it would be appreciated !

In reply to Eric Breton

Re: Get user token in SSO environment

by Peter Spicer -

Doing this is really difficult depending on the SSO environment you're doing it with.

There is a tracker item for it - https://tracker.moodle.org/browse/MDL-29583 - attached is a patch that makes webservices work like this for Shibboleth (at least for most Shibboleth installs!), though it wouldn't be particularly hard to adapt it for other SSO flavours where the webservice user has to go off and essentially log in behind the scenes.