upbound / up

The @upbound CLI
Apache License 2.0
51 stars 41 forks source link

add alpha command for web login #421

Closed nullable-eth closed 6 months ago

nullable-eth commented 6 months ago

Description of your changes

Create alpha command for up alpha web-login. This supports SSO integration. When enabling SSO, upbound-api locks logins to SSO only and this means the cli would no longer be able to be used by those orgs. This allows web and SSO based logins via the up cli by creating a server listening for a callback, it then opens a browser to do a login. Any type of login can be done here, password, social or SSO (if SSO is enabled on an org then ONLY SSO may be used) and once logged in redirects to the callback in up cli passing it a time based one-time password. This TOTP is then exchanged for a session in upbound-api which is then stored and used by the up cli.

Note: in the case of headless terminals (ssh in to server) where a graphical web-browser cannot be used to complete SSO the up cli detects this and displays a link and QR code that can be used to authenticate on your phone or other device, once authenticated you can type in the 6 digit TOTP code and up cli will complete the login.

Fixes #

I have:

How has this code been tested

Tested locally and against dev