clasp icon indicating copy to clipboard operation
clasp copied to clipboard

Can't authorize clasp (login)

Open TeacherMN opened this issue 9 months ago • 5 comments

Hello. I've been trying to login to clasp as a Google Workspace user, but it always tells me that the admin hasn't allowed the service. However, I'm the admin of Google Workspace for my organization and I've made sure to allow the clasp app/service in the console. I'm at a loss as to what to do next, so any pointers would be welcome. Thank you.

The clasp IDs I have allowed are these two: 1072944905499-6jmucestgjua6htt8e2fdtvp90n5v12q.apps.googleusercontent.com 1072944905499-vm2v2i5dvn0a0d2o4ca36i1vge8cvbn0.apps.googleusercontent.com

These apps are allowed for the whole organization, not just some organizational units. I'm also trying to access the service with the superuser (admin) account from Google Workspace.

TeacherMN avatar Mar 05 '25 10:03 TeacherMN

Go here: https://script.google.com/home/usersettings

Enable the api there, try again

Good luck!

tdobson avatar Mar 05 '25 11:03 tdobson

Thank you for your answer. I tried your solution, but it still says that the app is not authorised (despite the fact that it is...)

TeacherMN avatar Mar 07 '25 07:03 TeacherMN

Did you have to enable it or was it already enabled?

What do you see if you do clasp login? Can you share screenshots etc?

tdobson avatar Mar 07 '25 10:03 tdobson

@TeacherMN When the system ask for your authorization look at all the permissions; you need to check them all because the authorization (now) is granular. https://workspaceupdates.googleblog.com/2025/01/granular-oauth-consent-in-google-apps-script.html

jppme avatar Mar 07 '25 11:03 jppme

Can you share exact error messages you're seeing?

There are cases where admin controls can prevent authorization or use of clasp (and apps script entirely!) but not clear from the issue which of these would be the root cause.

There's also an option in 3.0-alpha to set up your own internal GCP project. Previously bring-your-own project was reserved for the clasp run command but is no supported for all commands for instances where orgs have tighter restrictions on authorizing third-party applications. Might be something your admin needs to set up, but can be an option.

sqrrrl avatar Mar 19 '25 21:03 sqrrrl