Markkkk
Markkkk

Reputation: 1

Refreshing Client Secret JSON file for Gmail API

Hi I'm currently developing a help desk system as part of my coursework and as a part of this system, I used google's gmail api to send email "from" and "to" the same gmail account I used within the databases of my user.

I followed the steps laid out on Google's Java quickstart guide alongside this video https://www.youtube.com/watch?v=xtZI23hxetw&t=1354s which had help set-up the project GmailHandler util class. It was working for a week and now the json file that i had created had expired and was trying to renew it but couldn't find the means to do so.

I know it has 7 days limit since my project is on testing phase. What i did in hopes of getting more days was on the google projects - i made a new project and a new OAuth 2.0 Client ID to use within my app and replaced the old client secret json file with a new one generated by the client ID. I did read up about Oauth 2.0 playground to try and generate a new packet for it but to no avail.

I still get the error below and I have been trying to find similar posts to find out how I can renew my client secret json file. Does anyone know / have clue on how I would proceed to renew the Json file?

Exception in thread "main" com.google.api.client.auth.oauth2.TokenResponseException: 400 Bad Request POST https://oauth2.googleapis.com/token { "error": "invalid_grant", "error_description": "Token has been expired or revoked." }

Upvotes: 0

Views: 77

Answers (0)

Related Questions