clasp icon indicating copy to clipboard operation
clasp copied to clipboard

clasp login --no-localhost No Longer Working

Open starkprime opened this issue 3 years ago • 6 comments

Access blocked: clasp – The Apps Script CLI’s request is invalid This might be due to this: https://developers.googleblog.com/2022/02/making-oauth-flows-safer.html#instructions-oob

Steps to Reproduce the Problem

  1. clasp login --no-localhost

starkprime avatar Nov 05 '22 02:11 starkprime

is there a workaround because we have the same problem ?

lfourreau avatar Dec 05 '22 11:12 lfourreau

The workaround I use is locally doing a normal clasp login on your local terminal (not ssh'd in) having the browser pop up for the auth. And then rsync the the .clasprc.json to the remote host. It's pretty silly, but this works ¯_(ツ)_/¯

starkprime avatar Dec 05 '22 14:12 starkprime

Thanks for the work around starkprime however, my issue is I am trying to use Codespaces or gitpod so I can develop more robust Google Apps Script solutions from any Chrome browser. I am not sure how I could "rsync" the JSON file to the remote host. If you have some guidance on how to do that while using Codespace or gitod I would appreciate it (as would many others I would imagine!! )

oshag-mcesc avatar Dec 05 '22 19:12 oshag-mcesc

I am having the same issue on my end due to the move away from OOB.

leetutoring avatar Mar 29 '24 17:03 leetutoring

UPDATE: I just tried this and it is not working.... not sure what do do now... if someone gets it to work please pass it along as to how you did!

I had the same issue awhile ago. So far the following is working for me on Codesandbox and Gitpod

  1. $ clasp login
  2. Opened the URL that is given in the terminal
  3. Logged in as usual
  4. Copied the [error URL] from the browser
  5. Back in Gitpod open a new terminal
  6. $ curl [error URL] <--- paste erro URL from step 4 (obviously with out the brackets) And this should successfully log you in.

Here is the reference: google/clasp#953 (comment) (should work for gitpod as well) https://github.com/google/clasp/issues/953#issuecomment-1699810044

Hope this helps!!

oshag-mcesc avatar Mar 29 '24 18:03 oshag-mcesc

Thank you! That worked for me.

leetutoring avatar Apr 01 '24 00:04 leetutoring