Log In to the JFrog Platform with JFrog CLI
Log in to the JFrog Platform through a browser-based flow with jf login.
The jf login command opens a browser-based sign-in flow so you can authenticate to the JFrog Platform without typing passwords into the terminal. It is one of several authentication methods for the JFrog CLI, supported on Artifactory 7.64.0 or later, and is intended for interactive workstations with a local browser.
Prerequisites
- JFrog CLI installed (
jf --version) - Artifactory 7.64.0 or later on the target platform
- A browser available in your environment (not supported in headless/SSH sessions)
- Your JFrog Platform URL (for example,
https://yourcompany.jfrog.io)
Synopsis
jf loginAliases: none
Arguments
The following table lists command arguments.
| Argument | Required | Description |
|---|---|---|
| (none) | — | This command takes no arguments |
Options
This command has no flags.
Examples
Log in via Web Browser
To complete browser-based login:
- Run:
jf login- Follow the 5-step flow split between the CLI and your browser.
Step 1: Server selection
If you already have server configurations, the CLI presents an interactive menu. Use the arrow keys to select the server you want to log in to, then press Enter. To add a brand-new platform, select [New Server] and enter your platform URL when prompted.
Use the arrow keys to navigate: ↓ ↑
Select whether to create a new server configuration or to web login to an existing one:
> [New Server]
my-serverStep 2: Note the code and URL
The CLI prints a 4-character verification code and an authentication URL.
[Info] After logging in via your web browser, please enter the code if prompted: f087
[Info] Please open the following URL in your browser to authenticate:
[Info] https://yourcompany.jfrog.io/ui/login?jfClientSession=...&jfClientName=JFrog-CLI&jfClientCode=1Note
The verification code has 4 characters. You will need it in Step 4.
Step 3: Log in through the browser
Open the URL in your browser. Complete your normal login (username/password, single sign-on (SSO), MFA, and so on). If the browser does not open automatically, copy and paste the URL manually.
Step 4: Enter the verification code
After logging in, your browser displays a Verify Extension screen:
Please enter the code that you received from JFrog-CLI
Type the 4-character code from Step 2 and click Verify.
Step 5: Confirm success
The browser shows:
SUCCESSFUL LOGIN — Please go back to JFrog-CLI
You can close the browser tab. The CLI stores an access token and refresh token automatically.
When to Use
Use jf login for interactive developer workflows when you want a direct authentication experience. The browser handles SSO, MFA, and other identity provider flows (for example, SAML and OAuth) automatically.
Do not use jf login when:
- Running in CI/CD pipelines (no browser available). Use
jf c add --access-tokenor environment variables instead. - Running in headless or SSH environments. Use
jf c addwith token-based authentication. - You need scripted or automated authentication. Use
jf c add --interactive=false.
Important Notes
- Requires Artifactory 7.64.0 or later. Earlier versions do not support browser-based login.
- The CLI stores an access token and refresh token in
~/.jfrog/. Password-based authentication is replaced by the token. You do not need to log in again until the session expires. - The CLI prints the authentication URL and may open it automatically in your default browser. If no browser opens, copy the URL and paste it manually.
- You have about 5 minutes to complete the browser login. If the CLI times out, run
jf loginagain. A new session and code are generated each time. - If an error occurs, the CLI prints a Trace ID (for example,
Trace ID for JFrog Platform logs: abc123). Provide this ID to JFrog Support to help diagnose server-side issues. - The login updates the server configuration in place. Run
jf c showafter login to verify the updated server ID and authentication method. - If
jf loginis interrupted mid-operation, the server configuration may be left in a partially updated state (the server ID may have changed). Runjf c showto check, and use the current server ID in subsequent commands.
Expected Output
After running jf login and selecting a server, the CLI prints:
[Info] After logging in via your web browser, please enter the code if prompted: f087
[Info] Please open the following URL in your browser to authenticate:
[Info] https://yourcompany.jfrog.io/ui/login?jfClientSession=...&jfClientName=JFrog-CLI&jfClientCode=1After completing the browser flow (Steps 3 through 4), the CLI prints:
Login succeeded. Server configuration saved.If the session times out before authentication completes:
[Info] Trace ID for JFrog Platform logs: abc123...
[Error] Attempting to get authentication token from the JFrog Platform... executor timeout after 100 attempts with 3000 milliseconds wait intervalsTroubleshooting
Match your symptom to the following table to resolve a failed or confusing jf login run.
| Symptom | Likely Cause | Fix |
|---|---|---|
executor timeout after 100 attempts | Browser login was not completed within about 5 minutes | Run jf login again to start a new session |
| "Login has failed. Incorrect username/password or locked user" in browser | Wrong credentials or account locked | Verify your credentials, and contact your administrator if the account may be locked |
Server ID 'xxx' does not exist after an interrupted login | An interrupted jf login may have renamed the server ID | Run jf c show to find the current server ID and update any references to it |
| Browser shows "Verify Extension" but you missed the code | The 4-character code printed by the CLI before the URL was not noted | Run jf login again. A new code is generated each time |
| Browser does not open automatically | OS default browser not configured, or running in a restricted environment | Copy the URL printed by the CLI and open it manually in any browser |
Frequently Asked Questions
This section provides answers to frequently asked questions.
FAQs
Q: How do I log in to the JFrog Platform with the JFrog CLI?
A: Run jf login, select or add a server, then complete the 5-step browser flow. See Log in via Web Browser for the full procedure.
Q: What happens if I run jf login in a CI/CD pipeline?
jf login in a CI/CD pipeline?A: jf login requires a local browser, so it doesn't work in CI/CD or headless environments. Use jf c add --access-token or environment variables instead. See When to Use.
Q: What do I need before using jf login?
jf login?A: You need the JFrog CLI installed, Artifactory 7.64.0 or later, and a browser available in your environment. See Prerequisites.
Q: What is the difference between jf login and jf c add --access-token?
jf login and jf c add --access-token?A: jf login opens an interactive browser sign-in for workstations, while jf c add --access-token configures authentication with a token for scripted or CI/CD use. See When to Use.
Q: What happens if my jf login session times out?
jf login session times out?A: The CLI prints an executor timeout after 100 attempts error. Run jf login again to start a new session with a new code. See Troubleshooting.
Related Topics
Updated 2 days ago
What’s Next
For programmatic access and continuous integration and delivery (CI/CD), create an access token.
