When a user tries to create an access token using the Create Token REST API here (POST /access/api/v1/tokens), they can run into the below error:
Unsupported authentication method Basic
For this specific API, basic credentials are not allowed to be used if multi-factor authentication is enabled according to our documentation:
“If you use basic credentials, you must enable creation of tokens in the JFrog Platform UI.
For more information, see Enable Token Generation via API.
You cannot create a token through a REST API if you have enabled multi-factor authentication in the system and the basic-authentication-enforce-mfa flag in the access.config file is set to true.”
As a workaround, the user can pass the bearer token (Artifactory access token) into the command like below for example:
curl -H "Authorization: Bearer eyJ2Z...Hg" -XPOST "https://ARTIFACTORY_URL/access/api/v1/tokens" -d '{ "username": "user", "scope": "applied-permissions/admin", "description": "Token for system metrics read access" }'