Area: API
Sub-Area: Authentication
Issue
Users were unable to create personal access tokens with a ONE_WEEK duration setting, while all other duration options (ONE_HOUR, ONE_DAY, ONE_MONTH) worked as expected. The API would either fail to create the token or return an error when this specific duration value was selected.
Common Error Messages:
- Token creation failed for duration ONE_WEEK
- Invalid duration parameter: ONE_WEEK
Solution
The issue has been fixed by correcting the backend validation and handling of the ONE_WEEK duration constant. All standard duration options now work correctly.
To create a personal access token via GraphQL:
mutation createAccessToken {
createAccessToken(
input: {
type: PERSONAL,
actorUrn: "urn:li:corpuser:username",
duration: ONE_WEEK, # Now works correctly
name: "My Weekly Token"
}
) {
accessToken
}
}
Additional Notes
Fixed in version v0.3.11. Personal access tokens are used for API authentication and programmatic access to DataHub.
Related Documentation
Tags:
personal-access-token, authentication, api, token-duration, bug-fix, v0.3.11