I'm writing an Android application which has a server connection. I would like to authenticate the app's user on the Android device and let the server know this has been done.
Assuming the user has:
AccountManager
successfullyI would like now to correctly and securely let the server know the app on the device has authenticated the user. How can the server validate that this isn't bogus? Is there a way to validate a token with Google and Facebook on a server without requiring user interaction?
Thanks.
you should take a look at this question: Generating Device-Specific Serial Number
you can take the account name based on the service it uses, like:
AccountManager am = AccountManager.get(this); // "this" references the current Context
Account[] accounts = am.getAccountsByType("com.google");
but you must declare it in manifest and ask the user to validate the permission.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With