0
votes

In My project with Google calendar api getting error message when trying to authenticate using the code that given by the url

https://accounts.google.com/o/oauth2/auth?access_type=offline&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcalendar.readonly&response_type=code&client_id=353577961315-njban7i0ach9ditqeojomv18lmqlcglp.apps.googleusercontent.com&redirect_uri=http%3A%2F%2Flocalhost%3A4200

Error message

Error while trying to retrieve access token { Error: invalid_grant at Request._callback (C:\Users\PC\Desktop\New folder\node_modules\google-auth-library\lib\transporters.js:81:15) at Request.self.callback (C:\Users\PC\Desktop\New folder\node_modules\request\request.js:188:22) at emitTwo (events.js:106:13) at Request.emit (events.js:191:7) at Request. (C:\Users\PC\Desktop\New folder\node_modules\request\request.js:1171:10) at emitOne (events.js:96:13) at Request.emit (events.js:188:7) at IncomingMessage. (C:\Users\PC\Desktop\New folder\node_modules\request\request.js:1091:12) at IncomingMessage.g (events.js:292:16) at emitNone (events.js:91:20) code: 400 }

What the reason for getting the error message and how can i resolve this issue?

1

1 Answers

0
votes

There are 2 common problems that cause invalid_grant errors:

  1. Your server's clock is out of sync with NTP
  2. You've exceeded the refresh token limit

I'd suggest investigating whether either of these issues could be the source of your problem.