iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
🤔

How does 'heroku login' authorize shell commands?

に公開

Please let me know in the comments if anything is incorrect!

A Browser Opens When You Run the heroku login Command

When deploying to Heroku or similar tasks, running this in your shell:

$ heroku login

will open a browser and display the login screen.
After logging in through the browser, you can then issue heroku commands from that terminal's shell.
However, even though you aren't entering an ID/password when executing the command,
why does logging in on the browser side allow you to execute commands as your own Heroku account?

Since I haven't registered a public key on the Heroku side,
it doesn't seem like it's using SSH with public key authentication (or something similar).

Note: You can also log in using the ID/password method by adding the -i, --interactive option.

It's Probably Determined by the Global IP Address

This is because under specific situations, such as when going through a proxy,
an error saying IP address mismatch occurs.

Since this is just a guess, I might be wrong.

References

Discussion