Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/general/login/help.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ Prerequisites:

Common patterns:
$ jf login
$ jf login --disable-token-refresh

Gotchas:
- Requires Artifactory 7.64.0 or newer; older targets must use 'jf c add'.
- Does not work in CI/headless environments — no browser to open.
- The flow stores credentials locally under ~/.jfrog/.
- --disable-token-refresh persists in the saved server config; omitting the flag on a later 'jf login' re-run leaves the previously saved value untouched.

Related: jf c add, jf c show, jf eot, jf atc`
}
9 changes: 8 additions & 1 deletion general/login/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,16 @@ import (
"github.com/urfave/cli"
)

const disableTokenRefreshFlag = "disable-token-refresh"

func LoginCmd(c *cli.Context) error {
if c.NArg() > 0 {
return cliutils.WrongNumberOfArgumentsHandler(c)
}
return coreLogin.NewLoginCommand().SetServerId(c.String("server-id")).Run()
loginCmd := coreLogin.NewLoginCommand().SetServerId(c.String("server-id"))
if c.IsSet(disableTokenRefreshFlag) {
disableTokenRefresh := c.Bool(disableTokenRefreshFlag)
loginCmd.SetDisableTokenRefresh(&disableTokenRefresh)
}
return loginCmd.Run()
}
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ replace (
github.com/CycloneDX/cyclonedx-go => github.com/CycloneDX/cyclonedx-go v0.10.0
// Should not be updated to 0.2.6 due to a bug (https://github.com/jfrog/jfrog-cli-core/pull/372)
github.com/c-bata/go-prompt => github.com/c-bata/go-prompt v0.2.5
// JGC-520: point at in-progress jfrog-cli-core branch - remove before merging
github.com/jfrog/jfrog-cli-core/v2 => github.com/jfrog/jfrog-cli-core/v2 v2.60.1-0.20260806050251-7359ffdda915

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please handle before merging

// Should not be updated to 0.2.0-beta.2 due to a bug (https://github.com/jfrog/jfrog-cli-core/pull/372)
github.com/pkg/term => github.com/pkg/term v1.1.0
)
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -408,8 +408,8 @@ github.com/jfrog/jfrog-cli-application v1.0.2-0.20260723152309-34eeb81e2847 h1:w
github.com/jfrog/jfrog-cli-application v1.0.2-0.20260723152309-34eeb81e2847/go.mod h1:p8yLtbmCxxQucIbLZKnWu0F+EDtj6NLXbRQCEK/nb6o=
github.com/jfrog/jfrog-cli-artifactory v0.8.1-0.20260804124646-1a5e6a2d3caf h1:HJob3Bsj6FtQ3nq72GGzBWXJ7ZXvUz6rKSGpYGAXwKI=
github.com/jfrog/jfrog-cli-artifactory v0.8.1-0.20260804124646-1a5e6a2d3caf/go.mod h1:UkVDiTbSgtk+7N2ePOsPvjPsgO8r8rJtUchjcnAk08w=
github.com/jfrog/jfrog-cli-core/v2 v2.60.1-0.20260804120604-edaa34435a80 h1:V8wTPQAO/9MMxYFMM5qD08E8QRCmV3EtS8Gh+7SmJzU=
github.com/jfrog/jfrog-cli-core/v2 v2.60.1-0.20260804120604-edaa34435a80/go.mod h1:MygQx8pekgPCXyXnejIAVG9S4ImGcDFmcfRPUug/0d0=
github.com/jfrog/jfrog-cli-core/v2 v2.60.1-0.20260806050251-7359ffdda915 h1:QLCzZ/xL/7DxAkV+rBitvE0Oq55LkmF5KEv/3glHU2I=
github.com/jfrog/jfrog-cli-core/v2 v2.60.1-0.20260806050251-7359ffdda915/go.mod h1:MygQx8pekgPCXyXnejIAVG9S4ImGcDFmcfRPUug/0d0=
github.com/jfrog/jfrog-cli-evidence v0.9.5 h1:YzkoYZtqChStPOxEj1odF7satpv1YPl1Zb/IZ/wZ9kc=
github.com/jfrog/jfrog-cli-evidence v0.9.5/go.mod h1:xTtHBeiVg3gbJ7jcx48sMlcWlCsRnvqlPKpbGJt22k0=
github.com/jfrog/jfrog-cli-platform-services v1.10.1-0.20260618062042-6053ab368cab h1:Zn/qB8LYhSu82YDtbqXwErN1RPHTHe/a3gQY6Ti/OBE=
Expand Down
2 changes: 1 addition & 1 deletion utils/cliutils/commandsflags.go
Original file line number Diff line number Diff line change
Expand Up @@ -2477,7 +2477,7 @@ var commandFlags = map[string][]string{
aptDistribution, aptComponent, aptTrusted, aptImportKey, aptRemove,
},
Login: {
serverId,
serverId, configDisableRefreshAccessToken,
},
}

Expand Down
Loading