You will integrate Google's Android/IOS SDK, get the id token after user has signed-in, and send the token to http://your-backend/token/new/social/by-token/google/mobile
- Sign your APP first. You will get a key store file.
- run
keytool -exportcert -keystore the-keys-store.jks -list -v
to get the sha-1 fingerprint - Get the configuration file. You will input the sha-1 fingerprint obtained during previous steps.
- [Go on with the integration] (https://developers.google.com/identity/sign-in/android/start-integrating)
- You can use a simple button instead of the button provided by the SDK. See google_sign_in_button
- See DashboardActivity for front end sample code
- Backend code is getEmailFromToken. You don't have to make any change, but you will set "googleWebClientId" and "googleWebClientSecret" on app.properties.(Yes, we use web client id on the back end even it's for mobile sign-in, as Google says so).
The previous setup is for the release version of your Android APP. You will encounter "unknown status code: 12501" (or 12500) errors during development, because you are running a debug version.
To get your debug version running,
- Find out the sha-1 fingerprint for debug.
keytool -exportcert -list -v -alias androiddebugkey -keystore ~/.android/debug.keystore
, input “android” as the password. - Go to the google developer’s console, create another clientId under the same project, input the debug fingerprint for it, and update the client-id and fingerprint on the google-services.json accordingly. See the comments in the sample code.
It's similar with the Android one. Can anybody help write the steps for IOS ?