Sample Usage with token
curl -H "Authorization: Bearer <valid access token>" -XPOST "http://localhost:8082/access/api/v1/tokens" -d "scope=applied-permissions/user" 200 { "token_id": "<id>" "access_token": "<access-token>", "refresh_token": "<refresh-token>", // optional "expires_in": "<seconds>", // optional "scope": "applied-permissions/groups:<group-name>" "scope": "applied-permissions/user", "token_type": "access_token" }
Sample Usage with user credentials
curl -u "login:password" -XPOST "http://localhost:8082/access/api/v1/tokens" -d "scope=applied-permissions/user" 200 { "user_id": "<id>" "password": "<password>", "refresh_token": "<refresh-token>", // optional "expires_in": "<seconds>", // optional "scope": "applied-permissions/groups:<group-name>" "scope": "applied-permissions/user", "token_type": "access_token" }
Errors
400 - Invalid input, e.g., expires_invalue is not a number, non-positive number, etc.
401- Unauthenticated
403 - The requested token details are forbidden, e.g.expires_inprovided but is higher than the limit defined by the admin, the user does not have the permissions on the scope he requested, etc.
Sample Usage with Project
curl --location 'https://<server-name>.jfrog.io/access/api/v1/tokens' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer <admin-token>' \ --data '{ "username":"jenkins", "scope":"applied-permissions/groups:CI", "project_key" : "test", "grant_type":"client_credentials" }