Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create the access token with the new access api endpoint instead of old artifactory endpoint when CLI is configured with username and password #2547

Open
VJ-JFrog opened this issue May 10, 2024 · 1 comment
Labels
feature request New feature or request

Comments

@VJ-JFrog
Copy link

This is the feature request created for implementing the new access API endpoint while creating access token when the CLI is configured with username and password.

Currently, when the CLI is configured with username and password, the jf atc command will not create a token as only the access token for CLI configuration is allowed. Below is the output we get when execute jf atc command.

jf atc
16:30:55 [Debug] JFrog CLI version: 2.56.0
16:30:55 [Debug] OS/Arch: darwin/arm64
16:30:55 [🚨Error] authenticating with access token is currently mandatory for creating access tokens

We can create access token with jf rt atc command but it is using the old artifactory API for creating the tokens.
Below is the sample output.

jf rt atc
16:52:07 [Debug] Usage Report: Sending info...
16:52:07 [Debug] Sending HTTP POST request to: https://JPD_URL/artifactory/api/security/token
16:52:07 [Debug] Sending HTTP GET request to: https://JPD_URL/artifactory/api/system/version
16:52:09 [Debug] Artifactory response: 200
16:52:09 [Debug] JFrog Artifactory version is: 7.XX
16:52:09 [Debug] Sending HTTP POST request to: https://JPD_URL/artifactory/api/system/usage

However, if we configure the CLI with an access token the jf atc command works fine and creates an access token accordingly. Below is the output.

jf atc
16:42:05 [Debug] JFrog CLI version: 2.56.0
16:42:05 [Debug] OS/Arch: darwin/arm64
16:42:05 [Debug] Usage Report: Sending info...
16:42:05 [Debug] Sending HTTP POST request to: https://JPD-URL/access/api/v1/tokens
16:42:05 [Debug] Sending HTTP GET request to: https://JPD-URL/artifactory/api/system/version
16:42:06 [Debug] Artifactory response: 200
16:42:06 [Debug] JFrog Artifactory version is: 7.XX
16:42:06 [Debug] Sending HTTP POST request to: https://JPD-URL/artifactory/api/system/usage
{
"scope": "applied-permissions/user",
"access_token": "eyJ2ZXIiOiIyIiwidHlwIjo...............deu0RRGdMlJUb73-YiVJr6ASgnfrrjtIEpicGCEggxwYxNV4VCH0qGjAJtIiHkhNabq7okMB16g",
"expires_in": 432000,
"token_type": "Bearer",
"token_id": "ac21-9d7463be6cb8"
}

Workaround:-
We can only use the jf atc command when CLI is configured with access-token.

What we need:-

We need to have the functionality to create access-token when the cli is configured with username and password with the new access token API endpoint.

@VJ-JFrog VJ-JFrog added the feature request New feature or request label May 10, 2024
@ggjulio
Copy link

ggjulio commented Jun 21, 2024

+1 that's a blocker for us.

The workaround is to continue using jf rt atc instead of jf atc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants