clasp login from Gitpod

98 views
Skip to first unread message

Vijay Tailor

unread,
Aug 30, 2023, 4:55:04 PM8/30/23
to Google Apps Script Community
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

Emerson Maia

unread,
Aug 30, 2023, 4:59:32 PM8/30/23
to google-apps-sc...@googlegroups.com
Dude that's cool I tried to use it and never got it, I'll try that., thanks for the tip.


--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/185c1558-5a6f-441c-920a-be8c859c8d6dn%40googlegroups.com.

Vijay Tailor

unread,
Aug 31, 2023, 10:21:18 AM8/31/23
to Google Apps Script Community
Glad you found it useful. I suspected this might be a problem someone else has come across, especially now, when dockerization has become a practical must for development environments
Reply all
Reply to author
Forward
0 new messages