With Google Sign-In going away, developers would need to work with a new service called Google Identity.
But As with Google, this has become a mess of docs and seemingly relevant code which will render your app unusable. My team spent two days implementing both of them due to this mess. So I am gonna make it simple for you to decide.
With this Google Identity service, Google has designed two flows
This is the newest sign-in-flow for developers without much need for handling oauth.
It goes like this,
App code triggers a google-sign in
your code gets back JWT token
using a standard JWT decoder, you can read names and emails.
It is that simple.
Steps:
If you are the developer building integration with Google APIs, forgot above and you must do Authorisation flow. I know names are confusing. But let it be. You need Auth from the user to access his/her google docs. So, Authorisation for you.
Steps:
Note: There are two models of authorization: Code model and Token model. https://developers.google.com/identity/oauth2/web/guides/choose-authorization-model.
Token model is useful only if all the actions are done from the user’s browser. If you want to use that, Refer https://developers.google.com/identity/oauth2/web/guides/use-token-model.
If your apps work offline, Go with the Code model as shown in the above steps.
This was an introductory article to give a general idea of Google Identity Services. It is not a step-by-step tutorial. Google Docs has provided all that but in a messy structure. So I have given you direct links. Enjoy!