jf access-token-create

Create an access token. By default, you get a user-scoped token. Administrators can provide scope with --scope, or implicitly with --groups or --grant-admin.

Synopsis

jf access-token-create [username] [options]

Aliases: jf atc

Arguments

ArgumentRequiredDescription
<username>NoUsername for which the token is created. Omit to create for the current user

Options

FlagShortDefaultDescription
--urlJFrog Platform URL
--userJFrog username
--passwordJFrog password
--access-tokenJFrog access token for authentication
--server-idServer ID from jf config
--projectJFrog project key
--grant-adminfalseGrant admin privileges (administrators only)
--groupsComma-separated list of groups (administrators only)
--scopeToken scope (administrators only)
--expiryplatform defaultToken expiry in seconds. Use 0 for never-expiring
--refreshablefalseCreate a refreshable token
--descriptionFree-text token description (max 1024 characters)
--audienceSpace-separated list of Service-IDs that accept this token
--referencefalseGenerate a Reference Token (Artifactory 7.38.10+)

Examples

Create a Token for the Current User

jf atc

The command creates a token for the authenticated user. You must have a configured server or pass --url and --access-token.

Create a Token for a Specific User

jf atc <username> --url=<your-server-url> --access-token=<your-token>

Administrators create tokens for other users by specifying the username and credentials.

Create a Refreshable Token

jf atc --refreshable --expiry=3600

The token is refreshable, and a refresh token is returned for renewing it when it expires.

Important Notes

  • Default scope: Without --scope, --groups, or --grant-admin, the token has the same permissions as the creating user.
  • Expiry: If you don't set --expiry, the platform's default token expiry applies. Use --expiry=0 for a token that never expires (use with caution).
  • Reference tokens: Use --reference to create a reference token (available in Artifactory 7.38.10+). Reference tokens are stored in the database and can be revoked individually.
  • Refreshable tokens: Use --refreshable to get a refresh token alongside the access token. This is useful for long-running CI/CD pipelines that may outlive the token's expiry.
  • Admin-only flags: --grant-admin, --groups, and --scope require admin privileges. Non-admin users can only create tokens for themselves.
  • Security: Tokens are displayed only once at creation time. Store them securely. If lost, create a new token.


What’s Next

For automated CI/CD authentication, see OIDC token exchange.