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

Authorization code is not showing up in authorization flow #95

Open
bedefrunner opened this issue Jul 2, 2020 · 2 comments
Open

Authorization code is not showing up in authorization flow #95

bedefrunner opened this issue Jul 2, 2020 · 2 comments

Comments

@bedefrunner
Copy link

bedefrunner commented Jul 2, 2020

Expected Behavior

After following the link printed in the console when doing the quickstart, an authorization code should appear so I can copy-paste it in my console.

Actual Behavior

I can access the link, which guides me through the following steps:

  1. It asks me to select one of my gmails accounts.
  2. Then it shows "This app isn't verified", so I click Advanced > Go to {Project Name}
  3. A pop up asks to give permission to the app to my account's calendar, I select "allow"
  4. Then it asks me to confirm my options. I click on "allow"
  5. It redirects me to my app's landing page

Where is the code I should see to copy and paste into my console?

Specifications

  • Node version: v12.16.0
  • OS: Linux (actually, Ubuntu running in WSL2)
@bedefrunner
Copy link
Author

Solved. The problem was that the first step that the API asks you for in its official tutorial is to click on the "Enable Google Calendar API" button, where it asks you to write the URL of your web server. The description says: "this is the path in your application that users are redirected to after they have authenticated with Google. The path will be appended with the authorization code for access". The problem was that I wrote the home path of my application myapp.com/, but my application never "stays" in that path but automatically redirects to myapp/sessions/login, so the code for access was "lost". Now that I changed the path to miapp/sessions/login I could see the code appended to that path.

@Lathryx
Copy link

Lathryx commented Feb 17, 2021

Solved. The problem was that the first step that the API asks you for in its official tutorial is to click on the "Enable Google Calendar API" button, where it asks you to write the URL of your web server. The description says: "this is the path in your application that users are redirected to after they have authenticated with Google. The path will be appended with the authorization code for access". The problem was that I wrote the home path of my application myapp.com/, but my application never "stays" in that path but automatically redirects to myapp/sessions/login, so the code for access was "lost". Now that I changed the path to miapp/sessions/login I could see the code appended to that path.

To clarify, when you go through the authorization process and reach the URI callback (mine was simply https://google.com), the code will be held as the first parameter in the URL. For example, my URL would be something like this:

https://www.google.com/?code={CODE WILL BE HERE}&scope.......

Simply copy the space labeled {CODE WILL BE HERE} in the above line. Once authorized, a file named token.json should be created and automatically used from that point on.

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

2 participants