randomBrainstormer / MMM-GoogleCalendar

Google Calendar for MagicMirror²
MIT License
64 stars 42 forks source link

Periodic Invalid Grant #59

Closed alexio215 closed 2 months ago

alexio215 commented 4 months ago

Hello, I keep getting invalid grant every few days or weeks or so. I do not know exactly when it stops. However, it is periodic.

I delete my token file. And run authorize from scratch. It tends to work for a few days, and then stops. Is there a common issue that I am not aware of? Has anyone taken any steps to diagnose this?

Thank you kindly in advance.

randomBrainstormer commented 4 months ago

Hi @alexio215 , this is a common issue, it typically arises when your app remains in "test" mode, leading to tokens expiring approximately every week or so. To resolve this, you need to publish your app on Google Cloud Platform:

  1. Navigate to your Google Cloud Project.
  2. Go to the "OAuth consent screen" tab.
    1. Locate the "Publishing Status" section.
    1. Here, you should see an option to "Publish App." Click this button.
    1. Review and confirm the necessary permissions as prompted.
  3. By publishing your app, you extend the token's lifespan, eliminating the need for frequent reauthorizations.
alexio215 commented 4 months ago

@randomBrainstormer Thank you very much. I just had a quick question regarding this. Does it become an issue of it becoming available to the public? Or does the data and module stay private? Thank you, and apologies if any of the questions come as naive.

randomBrainstormer commented 4 months ago

Hi @alexio215, no worries at all – your questions are absolutely valid! You can rest assured that it's safe: your data remains private since you're the only one authenticating against your own app, and the OAuth credentials are used solely within your instance of the plugin, there's no public exposure to worry about ; ) If you have any more questions, feel free to ask! 😊

Kayakbabe commented 3 months ago

Changing the credentials to take it out of testing mode worked great for me. Thanks randomBrainstormer for explaining it so well.

randomBrainstormer commented 2 months ago

Closing this issue for now, but if you require any further assistance, feel free to let me know, @alexio215