Get Tokens

JFrog REST APIs

Products
JFrog Xray
Content Type
REST API
ft:sourceType
Paligo

Description: Returns token information, based on the authenticated principal and optional filters.

Since: 7.21.1

Security: Requires a valid token.

Usage: GET /access/api/v1/tokens

Produces: application/json

{
  "tokens": [
    {
      "token_id": "<id>",
      "subject": "<subject>",
      "expiry": <epoch-in-secs>,       // optional
      "issued_at": <epoch-in-secs>,
      "issuer": "<issuer>",
      "description": "<description>",  // optional
      "refreshable": <true|false>
    }, 
    ...
  ]
}

Note

  • An admin user can get all tokens.

  • Non-admin user gets only the tokens where his username matches the tokens' username.

  • If the query does not find any tokens, a response of 200 (i.e., successful) will be returned but with an empty list of tokens.

  • Supports query parameters to filter the response:

    • description=<description> (supports wildcard, the wildcard must to be at the end of the text)

    • refreshable=<true|false>

Errors:

  • 401 - Unauthenticated

  • 403 - The authenticated principal has no permissions to get tokens (not a user or not an admin token)

Sample Usage:

curl -XGET  -H "Authorization: Bearer <valid access token>" "http://localhost:8082/access/api/v1/tokens?description=my%20token*"

200 OK
{
  "tokens":[
    {
    }, ...
  ]
}