I've been using CLASP for the development of Google App Script. Clasp login
command is no longer working after Clasp logout
.
Steps
I've also tried using clasp login --no-localhost
, but it gave different error:
The problem is that your browser is forcing https://
on your localhost
. The way clasp login
works is that it creates a temporary local server to receive the authorization code from Google in the OAuth flow. This server won't have an SSL certificate so forcing an https connection will return that error. Your potential solutions are:
https://
to http://
, though if it's not working already it probably means that something is forcing it.edge://net-internals/#hsts
(or chrome://net-internals/#hsts
on Chrome) then add localhost
under "Delete domain security policies" and click "Delete".localhost
as an exception..clasprc.json
file from the other %USERPROFILE% folder to your current one. The credentials will be associated with the Google account that you used to sign in.As for why the -no--localhost
flag doesn't work, this is because the Out-Of-Band flow has been deprecated. You can see this in the full description of the error:
This means that the "enter a code" flow is no longer supported and Google has blocked it. It's up to the devs to update the Clasp app to remove the flow or to implement a workaround. You can try to report it in their Github page. As far as I can tell there's not much that can be done about this setting and you most likely will need to go with the localhost
method.