How does the auto login work?

1
Hello there, As I've read somewhere there is already some form of auto login functionality in Mendix if you use the login input widgets. I implemented this but now its very hard to see how the autologin works.  I made this for an app on Android. Sometimes I dont have to login and sometimes I do. There is no documentation to be found on it and the only thing i could find is the custom setting which sets the amount of auto logins before you have to fill them in again. But I've put that at unlimited.  Does anyone know what the logic behind this is? I'd rather not make a whole custom login widget.
asked
3 answers
1

Hi Hunter,

You can check out this blog that walks through how to implement this functionality. 

https://www.mattkdaniels.com/blogs/walkthrough-enabling-autologin-functionality-within-your-mendix-app

 

 

answered
1

Here are a couple of things I can think off that might be causing some issues.

https://stackoverflow.com/questions/15349237/handling-cookies-in-phonegap-cordova

Then there is this in the runtime config options:

https://docs.mendix.com/refguide/custom-settings

com.mendix.webui.HybridAppLoginTimeOut

Determines how many minutes your token will remain valid before re-authenticating using your full credentials.

This setting defaults to -1, which is equal to no timeout.

-1

I reckon the token is obviously a cookie, but as stated in the stackoverflow post Cordova / phonegap doesn't handle cookie storage well unless it is done in a specific way. Now I don't know how Mendix natively stores their cookies for this token. So maybe an insider of the Mendix R&D/Development can shed some light on that.

answered
0

Hello Hunter,

what version of Mendix are you running? There was an issue with tokens for online hybrid apps which will be solved in 7.16.0.

It might be you're running into that issue.

answered