How to create an 'Acess token' via Artifactory REST API?

995 Views Asked by At

my company uses Docker Desktop and we want to use this cool JFrog extension: https://github.com/jfrog/jfrog-docker-desktop-extension

We also have an JFrog XRay server, so all pre-requisites are fullfilled.

In order to establish a connection, I need to provide a so called 'access token' (AND NOT 'identity token') to the extension. Does someone know how to create such an 'access token' via REST API? All what I found deal with 'identity token'....

Best Valentin

I am expecting a simple http request with curl or whatever to generate such a personal access token.

2

There are 2 best solutions below

2
Yuval Ohayon On

use:

POST <your platform url>/access/api/v1/tokens

example:

curl -H "Authorization: Bearer <valid access token>" -XPOST "http://localhost:8082/access/api/v1/tokens" -d "scope=applied-permissions/user"

For more information, you can take a look at the documentation here.

0
Vaibhav Jain On

To generate an access token via a REST API, use the below cURL command:-

curl -H "Authorization: Bearer <valid access token>" -XPOST "https://<ART-URL>/access/api/v1/tokens" -d "scope=applied-permissions/user"

The above command will generate an access token and we can use this for configuring our docker-desktop extension. For more information regarding access tokens please refer to the Access Tokens documentation.