Problem Statement: User X wants to Log In or Signup to App A and App B.
Considering:-
- OS Environment: Android
- User X, Device D, App A and App B(App A and App B are two different organizations)
- App A and App B are on the same Device D
- App A and App B use the authentication SDK “SDK1”.
Approach 1: User X authenticates itself on App A via Mobile Number verification using OTP. User X authenticates itself on App B via Mobile Number verification using OTP.
Approach 2: User X authenticates itself on App A via Mobile Number verification using OTP. User X authenticates itself on App B by using the information from authentication on App A.
I am interested in exploring Approach 2 and want to know it’s feasibility and security implications.
Let's Deep dive into Approach 2 -
- User X authenticates itself on App A (that uses SDK1) by Mobile Number verification using OTP.
- SDK1 stores the information of SIM-ID and a unique Id in a file F on the device (in a shared space to which all Applications have access to), And sends this information to the server. Note: This file “F” is encrypted using a Symmetric Algorithm(e.g. AES); the key is remotely stored only at the server.
- User X tries to login into App B(that uses SDK1), the SDK sends the encrypted file F to the server where the server decrypts the file using the key generated at step 2 and validates the SIM ID and Device ID(SIM ID is kept in case I want to ensure that SIM is present in the device only). If the file data matches the data stored on the server then Server assumes that there is no need to do user authentication for App B again, as it has been already done during authentication for App A.
Problem I see in this approach:-
- If the File F is stolen then somebody else can impersonate user X and that can lead to identity theft(it can happen even if the file is encrypted) and security breach.
- All the applications will have access to this file so anybody can delete it.
- What should be the best option for device ID? Ad ID, Session ID, or something else?
PS: I don’t want to prompt the user for extra permissions.
Question- What are the solutions to the problem I listed above? Is there any other Security/Feasibility problem in implementing such an approach in the Android environment?
https://security.stackexchange.com/
is where you'd be looking to ask about security issues specifically, but be sure to read how that community works first – Aesthetic