I had an issue using clasp login from within Gitpod and after messing about with it, I found a solution, so I'm sharing it here.
Problem:
Loading an AppsScript project from Github into Gitpod for the first time. After the container is set up, I wanted to use clasp in order to create a new testing project, so I started off with clasp login, of course.
After following the login URL into a new tab and logging in with my Google account, I couldn't redirect back into localhost, as expected by the login workflow.
Initially, I tried to use clasp login --no-localhost, but Google doesn't support that login method anymore, because it is considered unsafe.
Solution:
Do everything normally:
- clasp login
- Open URL in new tab
- Login with Google
- Trying to redirect
Here's the trick:
- Copy the redirect URL from the browser address bar
- Go back to Gitpod
- Open a new terminal
- Run this: curl <pasted redirect URL>
- Close this terminal
- You are logged in to Clasp
That's it! From here everything is normal and you can use Clasp normally in your project
I hope it helps someone
Kind regards,
Tailor VJ