itchyny / calendar.vim

A calendar application for Vim
MIT License
1.95k stars 72 forks source link

[calendar] Fail in authorization to Google #171

Closed isene closed 4 years ago

isene commented 4 years ago

Suddenly, today I got "[calendar] Fail in authorization to Google" upon refreshing my calendar.vim.

Then, when I search around, I find the important notice in the Readme.md here about a new way to authenticate via GCP, etc. But, when I use the GCP link provided, it give me a free trial and then asks for payment. Is it so that from now on, I need to actually pay to continue using calendar.vim for my Google calendars?

isene commented 4 years ago

I should add that I have conky painting a two week calendar on my desktop via gcalcli - and that is still working like a charm.

itchyny commented 4 years ago

I recently invalidated the api key so users are required to create their own api key from now. Until yesterday, the application accepted 100 users (you were lucky) and Google send me a mail titled as Immediate action required to fill out the verification page but I don't want to spend my time to make my app pass the OAuth consent screen verification. Until Oct 2019, they were more tolerant that any developers can provide their OAuth application easily. However, they introduced OAuth consent screen configuration for proactive security measures to protect users from deceptive apps. The process was far more difficult than I thought. They require me to create a homepage describing the privacy policy, hosted within the domain of my own website, whose domain ownership is verified by Search Console. I just wanted to show a cool idea to the world. At least, I thought I was coding a cool software, implementing the date-time with Julian/Gregorian support in pure Vim script, floating window with syntax before Vim implemented the popup window, and Google Calendar/Tasks integration. Google used to provide a easy way to access their APIs but it seems it was easy for attackers too. They forces the API users to create a homepage about the privacy policy in more legally correct fashion. I've got totally less motivated to see all the TODOs in the mail they send me (in addition to privacy policy in homepage in the domain owned by me, YouTube video for demonstration of the app showing the full explanation of how the data will be used). Besides the OAuth problem, it is apparent that I have no motivation to maintain this project anymore. I would fix for security reason if found, but I won't implement new features anymore and I've got tired of answering to the issues in this repository. My personal free time is limited, I find much more fun coding in different languages than Vim script (for large apps like this repo at least), I haven't earn from this app at all, neither financially and technically.

isene commented 4 years ago

This is sad to hear - as your project is perhaps the most profound of all VIM plugins in the way you have organized the code and how well it functions. It is awkward to go back to the browser for my calendar needs.

isene commented 4 years ago

After playing around with various alternatives, I came back and gave it another shot. Here's what I get:

  1. I follow every step in the Important notice section of Readme.md.
  2. I get to "Create a new OAuth client ID. Select Other for the application type." and there is no option to chose "Other", so I chose "Desktop application" instead thinking that would be the closest.
  3. I finish adding the credentials to the cache file and verifies that it is indeed sourced by vim by doing ":echo g:calendar_google_api_key" and seeing that the API key is indeed correct.
  4. Upon restarting VIM and loading calendar.vim nothing happens. I do a C-R to refresh and I get "[calendar] Fail in authorization to Google". This is now where I'm stuck.
itchyny commented 4 years ago

Please delete the google/access_token and google/refresh_token in the calendar cache directory.

isene commented 4 years ago

Yohooo! Works. Thanks :-)

You may want to update the Readme-md to refelct that (and the lack of the "Other" option and also point the GCS link to a URL that does not require registering a credit card to continue (like https://console.developers.google.com/apis/dashboard or some such).

itchyny commented 4 years ago

I'm not sure which link leads to credit card... patches welcome.

Freed-Wu commented 4 years ago

image

is it the authorization error which @isene reported? now are there any method to solve it?

Freed-Wu commented 4 years ago

looks like https://github.com/itchyny/calendar.vim#important-notice

redapemusic35 commented 4 years ago

I am having trouble following the directions here. Does anyone know if there was a change made to the api process between the time the README. here was written and now? For instance, after adding the Tasks api from the library, I do not see any ../auth/tasks in add scope. Only ../auth/calendar

rogershijin commented 4 years ago

I am also experiencing the above issue - I can't find a ../auth/tasks scope either, but I can find a ../auth/calendar one. Events are syncing but tasklist can't be edited (hangs).

SkyLeach commented 4 years ago

I have written google apps before so getting to this point was relatively trivial. However there is no doubt that it isn't possible to get past the code point shown below (code safe to show b/c it is now invalid):

image

I haven't had the time to get into the code and find out why pasting the code isn't working, but it definitely is not working through the regular plugin to authenticate the app using the oauth key at this time.

details: in order to paste the key I did <ctrl>+r * to paste into the command window in standard style. I also attempted to do the same thing using the command console rather than using nvim-qt as shown here (not sure if it would work when snapped so I hid parts):

image

SkyLeach commented 4 years ago

I am having trouble following the directions here. Does anyone know if there was a change made to the api process between the time the README. here was written and now? For instance, after adding the Tasks api from the library, I do not see any ../auth/tasks in add scope. Only ../auth/calendar

use the search function -OR- you haven't enabled that API yet

redapemusic35 commented 3 years ago

I am getting this error. However, I can't tell if this is because this issue hasn't been solved yet or some other reason. I've tried all of the suggestions here as well as getting the most recent plugin. Is there anything that I am not doing?

duckpuppy commented 2 years ago

Has anybody gotten this to work recently? I always get the authentication failure in vim after going through the approval screens in Google and pasting in the resulting code. The API key is restricted to calendar and tasks APIs, and the oauth client config is scoped to allow basically all /auth/calendar* scopes plus the /auth/tasks scope.

nkarl commented 2 years ago

I have tried this in Neovim on Windows and apparently the calendar.vim sent out two separate authentication requests for the Calendar and Tasks API. Is this behavior expected?

I replicated the process in WSL and the Google Calendar authentication went through. The events from my Google Calendar showed up correctly. So it could be a problem with the neovim build on Windows.

felipeslanza commented 2 years ago

FWIW it finally worked for me after adding myself as a test user in the GCP OAuth Consent screen.