3

I followed this link and made a test page of google login by gapi. It worked, and did return the profile details.

Previously, I had tried this appraoch by passport.js, but because of the fragment problem, I did not manage to make it work.

In the passportjs appraoch, we could get a token. Does anyone know how we could get a token by gapi?

Additionally, does anyone know why we don't need to specify a secret in the code of gapi?

Community
  • 1
  • 1
SoftTimur
  • 5,630
  • 38
  • 140
  • 292

1 Answers1

0

You can get the token in the AuthResponse.

You do need an API key for gapi too:

gapi.client.init({
  'apiKey': 'YOUR_API_KEY',
  ...
})
rds
  • 26,253
  • 19
  • 107
  • 134