Refresh a Token

JFrog REST APIs

Products
JFrog Xray
Content Type
REST API
ft:sourceType
Paligo

Description: Refreshes the authentication token for an existing (non-transient) user.

Since: 1.2

Security: admin for itself and others (or with admin scope), user for itself only

Usage: POST /api/v1/security/token

Request Headers: N/A

Consumes: application/x-www-form-urlencoded

Field

Type

Required

Default Value

Description

grant_type

String

yes

The grant type used to authenticate the request. In this case, the only value supported is "refresh_token".

access_token

String

yes

The access token to refresh.

refresh_token

String

yes

The refresh token of the access token that needs to be refreshed.

expires_in

Long

no

0

The time in seconds for which the token will be valid. To specify a token that never expires, set to zero.

refreshable

Boolean

no

true

If true, this token is refreshable and the refresh token can be used to replace it with a new token once it expires.

cURL Example

$ curl -X POST -u user:password http://ARTIFACTORY_SERVER_HOSTNAME:8082/distribution/api/v1/security/token -d "grant_type=refresh_token" -d "refresh_token=fgsg53t3g…" -d "access_token=gsfdgw35gt..."

Response status codes:

200 - Successfully refreshed token

Response headers: N/A

Produces: application/json

Response

 {
        "access_token": "eyJ2ZXIiOiIyIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYiLCJraWQiOiJ6WWFWQjVFRlpkOXlpbWtCNkZTbDAtSWFhMHRPWldLX293c1BTVTNTZmdNIn0.eyJzdWIiOiJsZW5vbiIsInNjcCI6ImFwcGxpZWQtcGVybWlzc2lvbnNcL2FkbWluIiwiYXVkIjoiamZkc0AwMWNoMDV0ajRuM3NzODBzNm4zdjIzMDdiOSIsImlzcyI6ImpmZHNAMDFjaDA1dGo0bjNzczgwczZuM3YyMzA3YjkiLCJleHAiOjE1MzAwOTk2MTgsImlhdCI6MTUzMDA5OTQ5NSwianRpIjoiYTQzM2YwZDAtNTQ5OC00YjI5LWE5ODctZjI3MTNkYmMyOTdmIn0.E7csEhcHqsOJxz1jmhDVu_Ij51yQyxYifMXusexqZk78pi_7YHlJcY1iRg6VMthdv8_Db2CsaNzYdubCyTTt77OOTSVfqJdZsm_0AEz-paIj71lvgyJBFLZ2bjE253tMGLgweypUqqEsEH3J3FyfAaw4XXURlKT5inbwKklMu-DvPG5772ZS1Y6YPU8oOGc2dWg_BHUvjMTJ5vQAw0Ws5Ta2CJ0DF40JLQKcyN_JCgzQ2RCXr2C70JIF9Fa0OBaIKVT-DguSNGU83dnr-YF0XBsUcTDu5K-Jl5H3FMdb129awXe4_fLLdltMK8iAaRujsIDlvexdlezVal4nLRZcxA",
        "refresh_token": "f96bda0c-ab50-4b7e-96f1-be8bd20605a3",
        "expires_in": 123,
        "scope": "applied-permissions/admin",
        "token_type": "Bearer"
}