ARTIFACTORY: What causes the error message "Unsupported authentication method Basic" to appear when using a REST API?
Starting from JFrog Artifactory version 7.12, attempting to use basic authentication (username and password) for any Access-related REST API (APIs that begin with /access/) will result in an error. This error can be seen, for example, when attempting to obtain a list of users from Access:
$ curl -u "admin:password" "https://<JFROG_PLATFORM_URL>:<PORT>/access/api/v2/users"
{
"errors" : [ {
"code" : "UNAUTHORIZED",
"message" : "Unsupported authentication method Basic"
} ]
}
Thus, for every Access related API, you have to use an admin-scoped Access Token, or an Admin Identity Token.
How to generate an admin-scoped Access Token:To create an admin token, from the Administration tab, go to User Management | Access Tokens | Generate Admin Token.
How to generate an Admin Identity Token:Login as Admin, navigate to Welcome Admin | Edit Profile, unlock your profile and click on Generate an Identity Token.
Sample usage:
curl -H "Authorization: Bearer <Token>" https://<JFROG_PLATFORM_URL>:<8082>/access/api/v2/users