Area: Product Issues
Sub-Area: Personal Access Token (PAT) Management
Applies to: OSS + Cloud
Issue
You try to create or rotate a Personal Access Token (PAT) in the DataHub UI. You may see a warning that token authentication is disabled, or you may not see a new token in the Access Tokens list. You may also wonder whether the v2.1.2 MCP change affects tokens you pass in a header.
Error Messages
Token based authentication is currently disabled. Contact your DataHub administrator to enable this feature.-
Unauthorized to perform this action. Please contact your DataHub administrator.(returned when you are not allowed to create the token)
You Might Be Asking
- Why does the DataHub UI show "Token based authentication is currently disabled. Contact your DataHub administrator to enable this feature." when I open Access Tokens?
- I generated a new PAT but it is not in the Access Tokens list. Was it saved?
- Why is the Generate new token button disabled?
- How do I rotate a PAT?
- Does the v2.1.2 MCP change affect tokens I send in the
Authorizationheader? - Should I use a service account for automated pipelines?
Cause
-
Warning message: The Access Tokens page shows the alert
Token based authentication is currently disabled. Contact your DataHub administrator to enable this feature.when the app config valuetokenAuthEnabledis false. The frontend's default app config setstokenAuthEnabledto false, so the alert can show while that default is in effect. - Token list: The list loads through a search over access-token entities, not by reading tokens one by one.
- Disabled button or failed creation: In the UI, the Generate new token button is disabled unless token authentication is enabled and you have the Generate Personal Access Tokens platform privilege. The Manage All Access Tokens privilege does not enable the button.
-
MCP change: The DataHub Cloud v2.1.2 release notes list a breaking change. Every MCP endpoint, including
/mcpand/mcp/<slug>, takes the token only in theAuthorization: Bearer <token>header. A request with atokenquery parameter gets 400 Bad Request.
Solution
1. The "token authentication is disabled" alert
- Open Settings > Access Tokens and check whether the alert stays on the page.
- If it stays, token authentication is off for your deployment.
- Cloud: Contact DataHub Support. You can't change Cloud server settings yourself. In DataHub Cloud v2.4.4, metadata service authentication is on by default.
-
Self-hosted: Check that
METADATA_SERVICE_AUTH_ENABLEDistruein your GMS configuration.
2. A new token is missing from the list
- In DataHub Cloud, creating a token opens a dialog titled "New Access Token". It shows the token with a copy button and the warning "Make sure to copy your access token now. You won't be able to see it again." Copy the token before you close the dialog.
- Test the token with an API call. A successful response means the token works. Use the same host you use to browse DataHub:
curl -X POST '<your-datahub-url>/api/graphql' \
-H "Authorization: Bearer <your-new-token>" \
-H "Content-Type: application/json" \
-d '{"query": "{ me { platformPrivileges { generatePersonalAccessTokens } } }"}'
- Check the Access Tokens list again.
For the GraphQL endpoint and the Authorization: Bearer header, see How to set up GraphQL.
3. Rotate a PAT
- Go to Settings > Access Tokens.
- Click Generate new token. Give it a name and choose an expiration.
- Copy the token from the dialog before you close it.
- Update every integration that uses the old token. Check that each one works with the new token.
- Revoke the old token. A revoked token fails validation with
Failed to validate DataHub token: Token has been revoked. The GraphQL mutation isrevokeAccessToken(tokenId: String!): Boolean!.
The expiration choices come from the server's allowed durations. The default allowed list is 1 hour, 1, 7, 30, 90, 180 and 365 days. The Never option appears only when the server allows never-expiring tokens. In Cloud, never-expiring tokens have been disabled by default since v2.2.0, and existing tokens are unaffected. A NO_EXPIRY request that isn't allowed fails with an error that names ACCESS_TOKEN_ALLOW_NO_EXPIRY. Cloud customers: contact DataHub Support about this setting. Self-hosted operators set ACCESS_TOKEN_ALLOW_NO_EXPIRY and ACCESS_TOKEN_ALLOWED_DURATIONS. See the Authentication Configuration section of Environment variables.
See Creating Personal Access Tokens.
4. Token creation is disabled or fails
- Go to Settings > Permissions > Policies.
- Confirm that your user or group has the Generate Personal Access Tokens privilege. By default, the "All Users - Base Platform Privileges" policy grants it to all users.
- If the privilege is missing, ask an admin to add it, then try again.
The UI button needs Generate Personal Access Tokens even if you hold Manage All Access Tokens. In the API, creating a personal token needs either Manage All Access Tokens, or Generate Personal Access Tokens when the token is for your own user. Creating a token for a service account needs the Manage Service Accounts privilege. A caller without the right privilege gets Unauthorized to perform this action. Please contact your DataHub administrator.
See Managing policies.
5. Create a token with GraphQL
Use an existing valid token. Cloud and self-hosted both use your DataHub URL (the host you browse on) plus /api/graphql:
curl -X POST '<your-datahub-url>/api/graphql' \
-H "Authorization: Bearer <your-existing-token>" \
-H "Content-Type: application/json" \
-d '{
"query": "mutation createAccessToken($input: CreateAccessTokenInput!) { createAccessToken(input: $input) { accessToken metadata { urn } } }",
"variables": {
"input": {
"type": "PERSONAL",
"actorUrn": "urn:li:corpuser:<your-username>",
"duration": "ONE_MONTH",
"name": "my-rotated-token"
}
}
}'
Rules for the input:
-
type,actorUrnandnameare required. - Give exactly one of
durationordurationIso(for exampleP30D). - Valid
durationvalues areONE_HOUR,ONE_DAY,ONE_WEEK,ONE_MONTH,THREE_MONTHS,SIX_MONTHS,ONE_YEARandNO_EXPIRY. - There is no scope or permission field. You cannot limit a token at creation.
expiresAt is a field of AccessTokenMetadata, not of accessToken. On create, the returned metadata has only urn and type filled in. To read the expiry later, use listAccessTokens or getAccessTokenMetadata. Store the returned accessToken securely, then revoke the old token.
See Token management.
6. The v2.1.2 MCP change
If you use MCP endpoints, send the token in the Authorization: Bearer <token> header. Remove any token query parameter. If your client can't set headers, use mcp-remote with --header "Authorization: Bearer <token>".
See Connecting and authenticating to MCP.
7. Automated pipelines
Use a service account instead of a personal user. Service accounts are in Users & Groups, on the Service Accounts tab. That tab shows only for users with the Manage Service Accounts privilege. A service account token uses type: SERVICE_ACCOUNT and the service account's URN as actorUrn. Service accounts work in OSS and Cloud.
See Service accounts.
Related Documentation
- Creating Personal Access Tokens
- Token management (GraphQL)
- How to set up GraphQL
- Managing policies
- Service accounts
- Connecting and authenticating to MCP
- Environment variables (see the Authentication Configuration section)
Tags: personal-access-token, PAT-rotation, token-authentication, Authorization-header, MCP-security, v2.1.2, service-account, API-authentication, access-tokens