Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(chore) Unable to revoke tokens in dotCMS #30142 #30211

Conversation

valentinogiardino
Copy link
Contributor

@valentinogiardino valentinogiardino commented Oct 2, 2024

Proposed Changes

  • Added the 'Content-Type': 'application/json' header to the API call for revoking tokens.

Checklist

  • Tests
  • Translations: No changes needed.
  • Security Implications Contemplated: Fix ensures that API token revocation works as expected, reducing the security risk of lingering active tokens.

Additional Info

This fix resolved the issue where users were receiving a 415 Unsupported Media Type error when attempting to revoke tokens via the /api/v1/apitoken/{keyId}/revoke endpoint due to the absence of the Content-Type header in the request. By explicitly setting 'Content-Type': 'application/json', the server can now properly handle the request.

Screenshots

issue-api-token-fix.mov

This PR fixes: #30142

Copy link

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

@valentinogiardino valentinogiardino marked this pull request as ready for review October 2, 2024 13:42
Copy link
Contributor

@dcolina dcolina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏽

@valentinogiardino valentinogiardino added this pull request to the merge queue Oct 2, 2024
Merged via the queue into main with commit 98f280e Oct 2, 2024
35 checks passed
@valentinogiardino valentinogiardino deleted the issue-30142-unable-to-revoke-tokens-in-dotcms-api-call-returning-415-error branch October 2, 2024 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to revoke tokens in dotCMS: API call returning 415 error
5 participants