Log in and store the credential of the profile
Log in to the selected profile and store the credential.
In a terminal, rp asks how to sign in: with a web browser (the default, press Enter) or by pasting an access token. Choose with the arrow keys and Enter, or press 1 or 2. A terminal that cannot do that (a dumb TERM, a very small window, Windows) gets a numbered line prompt instead. The question is skipped, and rp goes on without it, with –no-browser (paste), –with-token (stdin), REPSY_TOKEN, no terminal or –no-input, and for a profile that has no web URL.
The browser sign-in is the browser callback: rp opens the panel’s authorize screen, you approve, and the panel hands a temporary token (valid 24 hours, not renewed) back to a port rp listens on at 127.0.0.1, so you paste nothing. A new login replaces the previous temporary token.
When the browser cannot be opened, rp prints the address of the authorize screen and keeps waiting: open it in a browser on this machine. If nobody opens it within 5 minutes, or if the opened browser does not answer in that time, or rp cannot listen on a loopback port, the login fails and rp suggests entering a token. rp never switches to that flow by itself.
Entering an access token (the paste flow) asks for the token and nothing else: rp prints no address and opens no browser. It runs when you choose it and with –no-browser. The username and password flow runs when the profile has no web URL. With REPSY_TOKEN set, or –with-token, there is no browser step at all.
When the 24 hours are over, commands answer 401 and rp says the sign-in expired; run rp auth login again. For CI use a personal access token (rp token create) in REPSY_TOKEN.
A host with no profile, no –type and a name that is not a known Repsy Cloud host is first asked which Repsy product it runs (an unauthenticated request to its login route, once per run), and the answer is stored in the profile. When the host cannot tell, rp warns and goes by the host name (Repsy OS).
–with-token reads an access token from stdin, for scripts and CI:
echo "$TOKEN" | rp auth login --with-token
The token is verified with the server before it is stored. While REPSY_TOKEN is set, login is refused: that variable is already the credential.
rp auth login [flags]
Options
--no-browser Do not run the browser callback; print the URL and ask for the token
--with-token Read an access token from stdin instead of asking for one
Options inherited from parent commands
--api-url string Panel API URL of the profile, overrides the stored value
--ca-file string PEM file with extra trusted CA certificates
--debug Print debug output with secrets redacted
--hostname string Repsy host to use instead of the current profile
--insecure Do not verify TLS certificates (unsafe; plain http is chosen with the URL, not with this flag)
--insecure-storage Keep credentials in a plain 0600 file instead of the OS keyring (unsafe; a warning is printed once per command)
--jq string Filter JSON output with a jq expression (implies --output json)
--no-color Disable colored output
--no-input Never prompt; fail when input is needed
--output table|json|yaml Output format: table, json or yaml (default table; json when --jq is given)
--owner string Owner segment of Cloud protocol URLs; --owner= means none
--registry-url string Protocol host URL of the profile, overrides the stored value
--type os|cloud Product of the host, overrides detection
--web-url string Panel UI URL of the profile (where /cli/auth lives), overrides the stored value
--yes Answer yes to confirmation prompts
See also
- rp auth - Sign in to Repsy and manage the stored credential