How to get validation if we logged in at another mobile?

How to get validation if we logged in at another mobile?

  

hello.. 

i want to build a mobile application, and user already logged in at their current device, but i want if user logged in at another device user status (logged_in) at previous device will automatically logged out like whatsapp. so, in outsystems how way to get validation if user use new device and want to logged out in their past device?

Hi Erron,

Afaik Whatsapp is based around phone number only, so there can never* be a situation that two devices both have a valid Whatsapp account. If you want an automatic log-off, you need to check on start-up of the app whether it still has a valid login. If not, it should log out and deny further access (without logging in again).

*Yeah, duplicate SIMs are a thing, but normally speaking.

Kilian Hekhuis wrote:

Hi Erron,

Afaik Whatsapp is based around phone number only, so there can never* be a situation that two devices both have a valid Whatsapp account. If you want an automatic log-off, you need to check on start-up of the app whether it still has a valid login. If not, it should log out and deny further access (without logging in again).

*Yeah, duplicate SIMs are a thing, but normally speaking.

what's the meaning valid login? is the user has been logged out or something?


"Valid login" in your case meaning that it isn't logged in elsewhere.

Solution

Erron Lolha wrote:

Kilian Hekhuis wrote:

Hi Erron,

Afaik Whatsapp is based around phone number only, so there can never* be a situation that two devices both have a valid Whatsapp account. If you want an automatic log-off, you need to check on start-up of the app whether it still has a valid login. If not, it should log out and deny further access (without logging in again).

*Yeah, duplicate SIMs are a thing, but normally speaking.

what's the meaning valid login? is the user has been logged out or something?


Hi Erron Lolha,

1)First create an entity with user id and device id

2)While user is registering for the application get the device id with "device.uuid" .

3)Use "device.uuid" inside javascript like this($parameters.DeviceHardwareId = device.uuid) and assign it to output variable and store in entity along with userid

4)while openning the application the splash screen will load , so there a screen action onload just check whether the present device user is logging is the same device id which is in entity along with userid if its not

5)there is a server action user logout(predefine) it will automatically log's out the user from the application

6)if he is trying to login on different system, change the device id with present device id and save .so when ever he is trying to open the application in old device it will ask him to login again  

Regards,

Koushik.


Solution

koushik prathi wrote:

Erron Lolha wrote:

Kilian Hekhuis wrote:

Hi Erron,

Afaik Whatsapp is based around phone number only, so there can never* be a situation that two devices both have a valid Whatsapp account. If you want an automatic log-off, you need to check on start-up of the app whether it still has a valid login. If not, it should log out and deny further access (without logging in again).

*Yeah, duplicate SIMs are a thing, but normally speaking.

what's the meaning valid login? is the user has been logged out or something?


Hi Erron Lolha,

1)First create an entity with user id and device id

2)While user is registering for the application get the device id with "device.uuid" .

3)Use "device.uuid" inside javascript like this($parameters.DeviceHardwareId = device.uuid) and assign it to output variable and store in entity along with userid

4)while openning the application the splash screen will load , so there a screen action onload just check whether the present device user is logging is the same device id which is in entity along with userid if its not

5)there is a server action user logout(predefine) it will automatically log's out the user from the application

6)if he is trying to login on different system, change the device id with present device id and save .so when ever he is trying to open the application in old device it will ask him to login again  

Regards,

Koushik.



for the entity is it local storage or database like usual? 

koushik prathi wrote:

Erron Lolha wrote:

Kilian Hekhuis wrote:

Hi Erron,

Afaik Whatsapp is based around phone number only, so there can never* be a situation that two devices both have a valid Whatsapp account. If you want an automatic log-off, you need to check on start-up of the app whether it still has a valid login. If not, it should log out and deny further access (without logging in again).

*Yeah, duplicate SIMs are a thing, but normally speaking.

what's the meaning valid login? is the user has been logged out or something?


Hi Erron Lolha,

1)First create an entity with user id and device id

2)While user is registering for the application get the device id with "device.uuid" .

3)Use "device.uuid" inside javascript like this($parameters.DeviceHardwareId = device.uuid) and assign it to output variable and store in entity along with userid

4)while openning the application the splash screen will load , so there a screen action onload just check whether the present device user is logging is the same device id which is in entity along with userid if its not

5)there is a server action user logout(predefine) it will automatically log's out the user from the application

6)if he is trying to login on different system, change the device id with present device id and save .so when ever he is trying to open the application in old device it will ask him to login again  

Regards,

Koushik.


can you give me a complete tutorial? i didn't understand with some point. i'm sorry if i troublesome you. i still newbie in outsystems.


Hey Erron,

  If you are going with koushik's idea, use a database entity. Also update the entity with user id and device id on registration and login actions. 


cheers.

Erron Lolha wrote:

koushik prathi wrote:

Erron Lolha wrote:

Kilian Hekhuis wrote:

Hi Erron,

Afaik Whatsapp is based around phone number only, so there can never* be a situation that two devices both have a valid Whatsapp account. If you want an automatic log-off, you need to check on start-up of the app whether it still has a valid login. If not, it should log out and deny further access (without logging in again).

*Yeah, duplicate SIMs are a thing, but normally speaking.

what's the meaning valid login? is the user has been logged out or something?


Hi Erron Lolha,

1)First create an entity with user id and device id

2)While user is registering for the application get the device id with "device.uuid" .

3)Use "device.uuid" inside javascript like this($parameters.DeviceHardwareId = device.uuid) and assign it to output variable and store in entity along with userid

4)while openning the application the splash screen will load , so there a screen action onload just check whether the present device user is logging is the same device id which is in entity along with userid if its not

5)there is a server action user logout(predefine) it will automatically log's out the user from the application

6)if he is trying to login on different system, change the device id with present device id and save .so when ever he is trying to open the application in old device it will ask him to login again  

Regards,

Koushik.



for the entity is it local storage or database like usual? 

its not a local entity,Because the local entity is specified to that particular device.


koushik prathi wrote:

Erron Lolha wrote:

koushik prathi wrote:

Erron Lolha wrote:

Kilian Hekhuis wrote:

Hi Erron,

Afaik Whatsapp is based around phone number only, so there can never* be a situation that two devices both have a valid Whatsapp account. If you want an automatic log-off, you need to check on start-up of the app whether it still has a valid login. If not, it should log out and deny further access (without logging in again).

*Yeah, duplicate SIMs are a thing, but normally speaking.

what's the meaning valid login? is the user has been logged out or something?


Hi Erron Lolha,

1)First create an entity with user id and device id

2)While user is registering for the application get the device id with "device.uuid" .

3)Use "device.uuid" inside javascript like this($parameters.DeviceHardwareId = device.uuid) and assign it to output variable and store in entity along with userid

4)while openning the application the splash screen will load , so there a screen action onload just check whether the present device user is logging is the same device id which is in entity along with userid if its not

5)there is a server action user logout(predefine) it will automatically log's out the user from the application

6)if he is trying to login on different system, change the device id with present device id and save .so when ever he is trying to open the application in old device it will ask him to login again  

Regards,

Koushik.



for the entity is it local storage or database like usual? 

its not a local entity,Because the local entity is specified to that particular device.


can i get the full tutorial? because i still newbie in outsystem

Hi Erron and Koushik,

First, may I ask both of you to stop hitting the "Reply" button and quoting everything, your posts get needlessly longer and longer.

Secondly, Erron, of course we could give you a tutorial, but the thing is, if you can't come up with it yourself given the explanations already given, you're probably just not skilled enough. You say yourself you're a newbie, and that's fine, we all have to start somewhere. But newbies should not try to implement very advanced features, like what you want, because that's bound to go wrong. First get some experience building simple, standard, stuff, then go for the more advanced topics.

Hi Erron,

Sorry for the late reply, I am attaching oml file just find it useful. 

Regards,

Koushik


Koushik Prathi wrote:

Hi Erron,

Sorry for the late reply, I am attaching oml file just find it useful. 

Regards,

Koushik



hi Koushik,

I am in need of a similar code for 'Mobile logout'. Your code exactly fits my requirement. When I try to use it, by scanning the QR code, it doesnt appear on my environment, do I need to recreate it for to be able to use it in my environment?

Regards,

Smitha

Hi SK1,

Yes, you have to pubish the oml file in your environment and then you have to generate the apk file then it will work.

Regards,

koushik