How to authorize a Google Client permanently until the user revokes authorization?
I am trying to make an app that connects to Google Calendar. It h
There are three types of codes or tokens Googles Authentcation server returns.
Authentication code
When a user clicks on the Authentcation form and grants your application access. Google returns to you an Authentcation code. You should take this code and exchange it for an Access token and a refresh token. This code is only used once if you try and use it again you will get an error message.
invalid_grant: Code was already redeemed.
Access token
Access tokens are used to access the APIs this token should be sent along with every request you make. Access tokens are short lived they work for an hour and then they stop working
Refresh token
Refresh tokens should be saved on your server some place. Once the access token expires you can use the refresh token to get a new access token.
Your problem is that you are saving the authentication code which is of no use to you. You need to find the refresh token and save that.