Access tokens

All external access to your Dynatrace monitoring environment relies on two pieces of information: the environment ID and an access token.

Dynatrace uses several types of tokens:

  • API tokens and personal access tokens grant access to the Dynatrace API
  • PaaS tokens allow download of OneAgent and ActiveGate installers
  • Tenant tokens allow OneAgent to report data to Dynatrace
  • Module tokens grant access to module integrations.

Token format

Dynatrace uses a unique token format consisting of three components separated by dots (.).

dt0c01.ST2EY72KQINMH574WMNVI7YN.G3DFPBEJYMODIDAEX454M7YWBUVEFOWKPRVMWFASS64NFH52PX6BNDVFFM572RZM

dt0c01 Prefix to identify the token.
ST2...7YN

Public portion of token

A 24-character public identifier of the token. This value can be safely displayed in the UI and can be used for logging purposes.

G3D...RZM

Secret portion of token

A 64-character secret portion of the token, which can be treated like a password and therefore doesn’t need to be displayed in the Dynatrace web UI (following initial creation) or stored in log files.

The predictable format gives you several advantages, such as:

  • Using Git pre-commit hooks to avoid pushing tokens to source code repositories (for example, using tools like git-secrets)
  • Defining masking rules to obfuscate the secret portions of tokens when writing log files
  • Detecting tokens in internal files or communications
  • Enabling the GitHub secret scanning service to identify any token pushed to a public GitHub repository

Use this regular expression to look for tokens:

api-examples/token-format.txt
Download
dt0[a-zA-Z]{1}[0-9]{2}\.[A-Z0-9]{24}\.[A-Z0-9]{64}

With the rollout of Dynatrace version 1.210, this format is enabled by default (all newly generated tokens will use the new format).

All existing tokens of the old format remain valid.

Disable the new format

For a limited time, you have the option to opt out of using the new token format. You can find the setting here:

  • SaaS and environment-wide Managed Go to Settings > Integration > Token settings.
  • Managed cluster In the CMC web UI, go to Settings > API tokens.

API token

API tokens are used by Dynatrace API to authenticate various API calls. API tokens have fine-grained scopes to limit access to specific product functionality for security reasons.

Token scopes

Create an API token

To generate an API token

  1. Select Settings in the navigation menu.
  2. Go to Integration > Dynatrace API.
  3. Select Generate token.
  4. Enter a name for your token.
  5. Select the required permissions for the token.
  6. Select Generate.
  7. Copy the generated token to the clipboard. Store the token in a password manager for future use.
    You can only access your token once upon creation. You can't reveal it afterwards.

You can assign multiple permissions to a single token, or you can generate several tokens, each with different access levels and use them accordingly—check your organization's security policies for the best practice.

Alternatively you can use the POST a new token API call to generate a token. Some tokens are only available via API.

Dynatrace doesn't enforce unique token names. You can create multiple tokens with the same name. Be sure to provide a meaningful name for each token you generate. Proper naming helps you to efficiently manage your tokens and perhaps delete them when they're no longer needed.

PaaS token

PaaS tokens are used to download OneAgent and ActiveGate installers. To generate a PaaS token

  1. Sign in using your Dynatrace account.
  2. Select Settings from the navigation menu.
  3. Select Integration > Platform as a Service.
  4. Select Generate token.
  5. Enter a meaningful name for your PaaS token. For instance, a meaningful token name might be the name of the PaaS platform you want to monitor (azure, cloud-foundry, openshift, etc).
  6. Select Generate to create the PaaS token. The newly created PaaS token is added to the Platform as a Service tokens.
    The PaaS token is essentially an API token used in combination with your environment ID to download OneAgent.
  7. Select Copy to copy the generated token to the clipboard. Store the token in a password manager for future use.
    You can only access your token once upon creation. You can't reveal it afterwards.

Alternatively you can use the POST a new token API call to generate a token with the InstallerDownload and SupportAlert permissions.

Tenant token

The tenant token is used by OneAgents and ActiveGates to report data to Dynatrace. Dynatrace automatically generates the tenant token and adds it to OneAgent and ActiveGate installers on download.

Access a tenant token

To obtain a tenant token of your environment, execute the GET connectivity information for OneAgent request of the Deployment API. You will find the tenant token in the tenantToken field of the response body. You'll need your PaaS token to authenticate the request.

Rotate tenant token

You can change the tenant token as needed (for example, to adhere to internal security policies or respond to unintended exposure). The procedure for changing the tenant token is called tenant token rotation. To learn how to rotate tenant token, see Rotate tenant token.

Module token

Module tokens are used by Dynatrace modules to report data to Dynatrace.

To generate a module token

  1. Select Settings in the navigation menu.
  2. Go to Integration > Dynatrace modules.
  3. Select Generate token for the module you need.
  4. Enter a name for your token.
  5. Select Generate

Alternatively you can use the POST a new token API call to generate a token with one of the following permissions:

Personal access token

All the above mentioned tokens require admin rights to generate. With personal access tokens you can generate a token for API usage without admin rights. Available scopes are bound to your permissions, that is, you can only use the API counterparts of features you're already authorized to use. You're also limited to the data from management zones you have access to.

A personal access token is bound to you. You can't generate a personal access token for another user.

Enable personal access tokens

Admin rights are required to enable this feature. Once enabled, any user can generate a personal access token.

To enable personal access tokens

  1. Go to Settings > Integration > Token settings.
  2. Enable Enable personal access tokens.

Generate personal access tokens

To generate a personal access token

  1. Select the user menu in the upper-right corner of the page.
  2. Select Personal access tokens.
  3. Select Generate new token.
  4. Enter a name for your token.
  5. Select the required permissions for the token.
  6. Select Generate.
  7. Copy the generated token to the clipboard. Store the token in a password manager for future use.
    You can only access your token once upon creation. You can't reveal it afterwards.

You can assign multiple permissions to a single token, or you can generate several tokens, each with different permissions—check your organization's security policies for the best practice. You can generate up to five personal access tokens.

Dynatrace doesn't enforce unique token names. You can create multiple tokens with the same name. Be sure to provide a meaningful name for each token you generate. Proper naming helps you to efficiently manage your tokens and perhaps delete them when they're no longer needed.