Inapp browser auto-login moodle mobile 3.2

Inapp browser auto-login moodle mobile 3.2

by Devendiran Deva -
Number of replies: 13

How enable the inapp browser auto-login in moodle mobile app v3.2

Average of ratings: -
In reply to Devendiran Deva

Re: Inapp browser auto-login moodle mobile 3.2

by Dani Palou -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Hello Devendiran,

there are some restrictions to make auto-login work:

  • The Moodle site needs to be 3.2 or higher. It doesn't work in previous Moodle sites.
  • Your site needs to use SSL (https).
  • After fulfilling the previous conditions, you should invalidate all tokens so the users create a new one. I think the easiest way is to go to the external_tokens table in your Moodle database and modify the value of "validuntil".

Also, please take into account that a certain user can only auto-login every 6 minutes (for security reasons). 

Kind regards,

Dani

In reply to Dani Palou

Re: Inapp browser auto-login moodle mobile 3.2

by Devendiran Deva -

Hello Dani,

I'm enable the ssl (https) , external in-app browser auto login work , but agin proplem is click back button and open another external browser link again ask user name & password..


Kind regards,

Deva


In reply to Devendiran Deva

Re: Inapp browser auto-login moodle mobile 3.2

by Dani Palou -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Hi Devendiran,

the in-app browser and the system browser use a different session. This means that authenticating in one of them won't affect the other. If you auto-login in in-app browser you'll have to wait 6 minutes to be able to auto-login in the system browser. Once authenticated in the system browser, the session should be kept for future requests.

Also, we detected that in some devices the in-app browser session is resetted when it's closed, so in that case the auto-login will only work once every 6 minutes in in-app browser.

Kind regards,

Dani

In reply to Dani Palou

Re: Inapp browser auto-login moodle mobile 3.2

by Yusuf Yilmaz -
Hello There,


One thing to note that Site admins cannot use this feature. So be careful to test the feature with a regular user.

Bests

Yusuf

Average of ratings: Useful (1)
In reply to Yusuf Yilmaz

Re: Inapp browser auto-login moodle mobile 3.2

by Dnyaneshwar Somwanshi -

i didnot understand , what is mean by inappbrowser.

i have some guess 

1. link "Website" in menu (which is by default)

2. link appeared in custom menu if we choose Custom menu items as "InappBrowser" from moodleweb mobile features

3. link appeared in custom menu if we choose Custom menu items as "embedded "from moodleweb mobile features

because neither of three option has autologin feature encountered with me.

i m using MoodleCloud and moodlemobile 3.3.1

clear me if i am wrong

thanks in advance.

In reply to Dnyaneshwar Somwanshi

Re: Inapp browser auto-login moodle mobile 3.2

by Dani Palou -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Hi,

when you create a custom menu item you have 3 options:

  1. browser: the page is opened in the system's browser (Chrome, Safari, Firefox, ...).
  2. inappbrowser: the page is opened in a "popup" (browser embedded in the app). The app opens a new window, like a popup, inside the app itself. You need to close this inappbrowser to be able to use the app again since it overlays the whole app.
  3. embedded: the page is opened inside the app itself, using an iframe. This is not a browser, it's similar to opening a SCORM.
The first 2 options, browser and inappbrowser, support auto-login. The third one, embedded, doesn't support it right now, we have an open issue to fix it:

https://tracker.moodle.org/browse/MOBILE-2161

Kind regards,

Dani 

In reply to Dani Palou

Re: Inapp browser auto-login moodle mobile 3.2

by Nur Azijah -
Hi, I want to ask, how can I log in automatically to custom menu items for browser and inappbrowser? Regards, Nur
In reply to Nur Azijah

Re: Inapp browser auto-login moodle mobile 3.2

by Dani Palou -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Hi,

the app should try to auto-login you if you open a custom menu item that points to the same site you have in the app, you don't need to do anything special. Please notice auto-login has some limitation, e.g. it doesn't work for admins, the site needs to use https and you need to wait a certain time between auto-login requests for each user.

Cheers,
Dani
In reply to Yusuf Yilmaz

Re: Inapp browser auto-login moodle mobile 3.2

by sadaf sadafian -

thank you Yusuf...

note to Admin of moodle can not use this possibility....regular user work for me

In reply to Dani Palou

Re: Inapp browser auto-login moodle mobile 3.2

by Sebastian Lamonega -

Hello Dani, I have a question, I dont know if is exactly related with this issue.


It is possible to make an app (moodle mobile) that automatically enter to moodle with one user? without the login step.

regards,

Seba

In reply to Sebastian Lamonega

Re: Inapp browser auto-login moodle mobile 3.2

by Dani Palou -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Hi Sebastian,

there are only 2 ways to authenticate a user:

  1. Entering the username and password (this gives you the user token).
  2. Using the user token (obtained in the step above).

To achieve what you want to do, you should manually create a token for the user (Site administration > Plugins > Web services > Manage tokens) and use that token to authenticate the user in a custom app, the official app doesn't support this. Please notice that this is really insecure since anyone with the token can access your site as that user.

Kind regards,

Dani

In reply to Dani Palou

Re: Inapp browser auto-login moodle mobile 3.2

by Bipund Pandey -
Hi Dani, 

I am trying to integrate autologin in custom moodle app which i design when i send private token for generate key it says following error 

{
"exception": "moodle_exception",
"errorcode": "invalidprivatetoken",
"message": "Invalid private token. Token should not be empty or passed via GET parameter."
}


i also override User-agent value to "MoodleMobile" so server know this request is coming from moodle app 

can you help me how i can generate a key for autologin 


Thanks in Advance