Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[calendar] Fail in authorization to Google #171

Closed
isene opened this issue Jun 9, 2020 · 18 comments
Closed

[calendar] Fail in authorization to Google #171

isene opened this issue Jun 9, 2020 · 18 comments

Comments

@isene
Copy link

isene commented Jun 9, 2020

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
Copy link
Author

isene commented Jun 9, 2020

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
Copy link
Owner

itchyny commented Jun 10, 2020

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
Copy link
Author

isene commented Jun 10, 2020

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
Copy link
Author

isene commented Jun 14, 2020

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
Copy link
Owner

itchyny commented Jun 15, 2020

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

@isene
Copy link
Author

isene commented Jun 15, 2020

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
Copy link
Owner

itchyny commented Jun 15, 2020

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

@itchyny itchyny pinned this issue Jun 17, 2020
@itchyny itchyny closed this as completed Jun 17, 2020
@Freed-Wu
Copy link

image

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

@Freed-Wu
Copy link

@redapemusic35
Copy link

redapemusic35 commented Aug 26, 2020

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
Copy link

rogershijin commented Sep 1, 2020

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
Copy link

SkyLeach commented Sep 9, 2020

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
Copy link

SkyLeach commented Sep 9, 2020

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
Copy link

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
Copy link

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
Copy link

nkarl commented Apr 15, 2022

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
Copy link

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

@alterGNU
Copy link

FWIW bis, if you're like me and having trouble getting your OAuth working, make sure you installed calendar.vim from our dear itchyny and not the fork from mattn, because his doesn't work (and he has the same README.md too, xD)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants