A bit of background:
- User enters credentials on every app launch instance.
- These credentials are sent as a part of the POST body (we encrypt them with a key using AES and put in the post body) to server and we get back a token which is some encoded string from the server.
- This token will authorize our app to make requests.
Now I would like you readers to focus on the fact that we need user credentials to get an authorization token in the first place.
- Token expires in 12 hours and all the subsequent requests are unauthorized and we are forced to kick the user out of the app to relogin again and get a new token which is good for another 12 hrs. I KNOW ITS A BAD EXPERIENCE.
Now we are required to implement a remember me functionality. I am NOT AT ALL COMFORTABLE using shared preferences (even with encryption, a serious hacker might get to the key in this case). What should I do ? I just came to know that the token web service is an oAuth2. Im a novice still looking at articles about oAuth2 and I saw where people have huge discussions about SharedPrefs and AccountManager api. But I saw this one answer by Reto Meier. He mentions that server should use oAuth. My question is given my scenario, what is the most secure way to do this and how can I use anything with oAuth to implement the remeber me functionality. Any kind of "clear" examples/clear explanantion would be a great help. Looking forward for your answers.