0

I am trying to create an API for Android clients similar to Google and Facebook

Both Google and Facebook have this process in their API's of generating some kind of hash from your android keystore. They say that only requests made from your packagename (eg. com.example.myapp) and that keystore's hash will be allowed and identified in their systems as you.

Google's method:

keytool -exportcert -alias androiddebugkey -keystore <path-to-debug-or-production-keystore> -list -v

and

Facebook:

keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64

How would I implement my API to guarantee secure identifiable requests from the Android client to my backend.

thanks!

Michael Barany
  • 1,639
  • 1
  • 12
  • 15

1 Answers1

1

You can obtain application signature as it suggested here. That you can use MD5 or SHA1 to encode it.

There are many Java libraries for SHA1 and MD5, here is one I googled.

Community
  • 1
  • 1
Ilya Gazman
  • 31,250
  • 24
  • 137
  • 216