Skip to content

Refresh JFrog Token

Create a refreshable access token

Important information:

  • Access token will need to be created with refreshable set to true (default is false)
  • If a refresh token is missing or lost, the user won’t be able to generate a new token with the desired permissions. In such situations, the token will need to be created again from scratch and it will be impossible to modify or change the existing access tokens without the refresh token
  • Because we use SAML SSO authentication, you need to create an identity token first (can use jfrog UI) before create a refreshable token
  • More resources can be found at JFrog Artifactory Guide

Create a token with refreshable set to true using API call:

curl -H "Authorization: Bearer <Token>" -XPOST "https://jfrog.ford.com/access/api/v1/tokens" -d "refreshable=true" -d "include_reference_token=true" -d "description=test refresh token"

Simple output:

{
  "token_id" : "e2dd4c6d-88f4-413f-a013-700083a029c6",
  "access_token" : "<access_token>",
  "refresh_token" : "<refresh_token>",
  "expires_in" : 31536000,
  "scope" : "applied-permissions/user",
  "token_type" : "Bearer"
  "reference_token" :"<reference_token>",
  "description" : "test refresh token"
}

Renew a refreshable access token

Using refresh token API to refresh the same token created above:

curl -H "Authorization: Bearer <access_token>" -XPOST "https://jfrog.ford.com/access/api/v1/tokens" -d "grant_type=refresh_token" -d "refresh_token=<refresh_token>" -d "include_reference_token=true"

Note: <reference_token> can be used in place of <access_token> from curl command above

Simple output:

{
  "token_id" : "d60de904-3444-4a65-87bc-7ae8fb1c2163",
  "access_token" : "<access_token>",
  "refresh_token" : "<refresh_token>",
  "expires_in" : 31560000,
  "scope" : "applied-permissions/user",
  "token_type" : "Bearer"
  "reference_token" :"<reference_token>",
  "description" : "test refresh token"
}

Brought to you by DevTools and Enablement Team.