Android Moodle App not working with custom Auth Plugin

Re: Android Moodle App not working with custom Auth Plugin

by Juan Leyva -
Number of replies: 5
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Hi,

you need to implement this hook in the auth plugin:

user_authenticated_hook (This method is called from authenticate_user_login() for all enabled auth plugins)

The app doesn't use the login/index.php to authenticate

Maybe this works for you:

function user_authenticated_hook ($user, $username, $password) {

$this->loginpage_hook();

}

 

Regards

In reply to Juan Leyva

Re: Android Moodle App not working with custom Auth Plugin

by kapy kato -
 Hello Mr. Juan Leyva

Can you help me with the following concerns:

How can i  resolve the access from Android to Moodle?
Is the URL https://server/login/index.php  used or is another one used?
How can i start the web browser after the authenticated (only web browser, without web services)?


Regards



In reply to kapy kato

Re: Android Moodle App not working with custom Auth Plugin

by Juan Leyva -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Hello Kapy,

I'm sorry but I don't understand your message, what are you willing to do? what problems are you having?

Regards, Juan

In reply to Juan Leyva

Re: Android Moodle App not working with custom Auth Plugin

by kapy kato -

Thanks Juan
Could you help me pass this question to the forum in Spanish, my English is limited. I have a project that can be interesting and I would be very helpful recommendations.

 Sorry for my mistakes in the message.


Regards


In reply to Juan Leyva

Re: Android Moodle App not working with custom Auth Plugin

by kapy kato -

Hello Mr. Juan

I want to get the authentication from moodle (say the moodle site from our university) in my android application. And I do not have the access to the database. I tried to make a http post request from my application with username and password.

Is the URL https://server/login/index.php  used or is another one used?
How can i start the web browser after the authenticated (only web browser, without web services)?

Regards


In reply to kapy kato

Re: Android Moodle App not working with custom Auth Plugin

by Juan Leyva -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Hi Kapy,

the only way for launching a browser and at the same time authenticate the user is opening a browser in Android doing a POST request to login/index.php with the user credentials (username and password)

I don't really know if that's possible in Android, I suppose you can create a temporary html files doing the POST with the user credentials via javascript and then open the browser pointing to that file, but this seems to be insecure.

Cheers, Juan