googleworkspace / php-samples

PHP samples for Google Workspace APIs
Apache License 2.0
288 stars 348 forks source link

Missing required parameter: scope #26

Closed gregfr closed 5 years ago

gregfr commented 5 years ago

I've followed step by step this tutorial here: https://developers.google.com/sheets/api/quickstart/php When opening the given URL, I see this error:

  1. That’s an error. Error: invalid_request Missing required parameter: scope

If I add a scope parameter ("https://www.googleapis.com/auth/plus.login") to the URL manually, I get this error:

  1. That’s an error. Error: invalid_request Invalid parameter value for redirect_uri: Missing authority: urn:ietf:w

Why are these parameters missing? how can I have a proper URL generated?

Thanks in advance

Expected Behavior

URL gives a login screen

Actual Behavior

URL gives a 400 error

Steps to Reproduce the Problem

  1. Follow the tutorial
  2. Click on the URL provided

Specifications

gregfr commented 5 years ago

I found the problem: the URL was too long and the terminal wasn't handling it correctly...

Now I have this error:

PHP Fatal error: Uncaught Google_Service_Exception: { "error": { "code": 403, "message": "Request had insufficient authentication scopes.", "errors": [ { "message": "Request had insufficient authentication scopes.", "domain": "global", "reason": "forbidden" } ], "status": "PERMISSION_DENIED" } }

erickoledadevrel commented 5 years ago

Not sure there is anything we can do to prevent this, the OAuth approval URL is rather long. Let me know if you have any ideas.