Offline Authentication/Login in Native Mobile app

Offline Authentication/Login in Native Mobile app

  

Hi,

I need my app allows offline authentication. This is because most of the time de mobile app will work in offline mode, so when it´s online it will synchronize all data on server. I tried with an IF in the Login client action that verifies if it is online or not; if online call DoLogin Server Action, but if offline I'm  trying to match the username and password  with some Username and Password stored in a Local Entity (LocalUser) but I´m not able to do that, because it seems that no data is retrieved even from LocalStorage before Login. I marked all screen as Anonymous but still nothing.


Can anyone help me with this? How can I have both login mode?


Regards

i would recommend you to watch this video, which explains how to do an offline web app from start to finish

https://www.outsystems.com/learn/lesson/1191/create-your-offline-app/

I´ve already watched this video, and no Login or authentication in offline mode has been shown. It's a very good guide, but it doesn't solve my problem. I need a user to logout and the same user or another one logins, all this while offline.  

You should be able to just check if a user exists in a local storage table and compare it with the information input in your login screen.

What are your issues when you do that?

That's the problem. No data is retrieved before Login. In the image attached the GetLocalUser is always empty even if there is data in it. When I login online and right after that I configure my phone to be offline, I can list all users from LocalUser anyway.

Maybe my logic in the image is wrong.


Thanks.

Two things: when is that action being called? do you have any filters in the database query?

1- The action is called when I click Login Button on Login Screen (Common->Login)

2- I have a filter by the input username val. But even without a filter, It doesn't get any data from LocalStorage.


Regards.

 

hum. That is very weird. I don't have any trouble retrieving local information precisely in the same spot as you.

Would you mind attaching the oml you're using so I could take a closer look?

After checking step by step, now I can login the way I wanted but just only one more time after i get offline. If I want to login more than once with each user, no data is retrieved anymore.

 

for some reason the oml attachment is "processing upload" since yesterday

Ricardo Silva wrote:

for some reason the oml attachment is "processing upload" since yesterday

I'll try to upload again today


My OML