Reputation: 502
I have been searching Google to find a answer to if it is possible to restrict users to login from one device at a time.
Suppose there is a mobile application (iOS application) which allows one user to login from one device at a time. How can this be achieved ?
To solve this problem, I think the first thing is to identify a device. Maybe by its Mac address, but I did not find any way to fetch the Mac address of a device from user request made from a the application as any identifiers which directly identifies the iOS Device is strictly prohibited by Apple Privacy Policy.
So for this I am trying to do the following things:
For creating custom UUID I am using the following code :
let uuid = NSUUID().UUIDString.lowercaseString
print(uuid)
I am saving this UUID to my keychain.
So while thinking to apply the above steps I came to a very serious concern
How to manage the UUID in the above scenarios? It would be really helpful if anyone could share some thoughts about possible solutions. Thanks!
Upvotes: 0
Views: 940
Reputation: 306
you have to use the token approach and you have to manage it from the backend if is there any new login appear the previous token should expire and in app whenever the token expires it should move to the login screen, and to use UDID for this purpose it is completely illegal or maybe your app gets reject when you submit it to the app store thanks.
Upvotes: 1