node-samples icon indicating copy to clipboard operation
node-samples copied to clipboard

400. That’s an error. Error: invalid_request

Open pawel-gorski-droptica opened this issue 5 years ago • 5 comments

Expected Behavior

after run node . links genere but not working Authorize this app by visiting this url: https://accounts.google.com/o/oauth2/v2/auth?access_type=offline&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcalendar.readonly&response_type=code&client_id=xxxxxxxxxxxxxxxxxxxxx6.apps.googleusercontent.com&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob Enter the code from that page here:

Actual Behavior

  1. That’s an error.

Error: invalid_request

Missing required parameter: redirect_uri

Learn more

Request Details That’s all we know.

Steps to Reproduce the Problem

  1. put code in index.js
  2. node .

Specifications

  • v8.10.0
  • OS (/Linux/ ubunut)

pawel-gorski-droptica avatar Jul 06 '19 11:07 pawel-gorski-droptica

I'm not able to reproduce this without intentionally omitting the redirect_uri in the URL when copy/pasting. Are you sure you copied the URL into the browser correctly?

sqrrrl avatar Jul 08 '19 20:07 sqrrrl

Hi I have the same problem.

  1. That’s an error.

Error: invalid_request

Required parameter is missing: response_type

Learn more

Request Details access_type=offline scope=https://www.googleapis.com/auth/drive

That’s all we know.

Maybe it is true because i am connect at localhost ?

zababurinsv avatar Jul 17 '19 05:07 zababurinsv

Please post the actual URLs. Note that there's no secret information in the URLs -- the client IDs are considered public info as they're visible to end users in the redirect URL.

For the original issue, tried using same URL with my client ID and it worked fine. Perhaps it's something more with how you're opening the URL? Bad copy/paste into the browser?

sqrrrl avatar Aug 15 '19 21:08 sqrrrl

you have to add a redirect_uri to your google project on google cloud. the tutorial does not do this or mention it

alechash avatar Dec 17 '20 19:12 alechash

seems like OAuth key have the redirecturi included. service account does not.

tanjunior avatar Jun 22 '21 01:06 tanjunior