docs(api): use PKCE for ReadMe docs OAuth - #903
Merged
Conversation
Contributor
Author
|
@seferturan With https://github.com/trakt/trakt-workers/pull/1426 merged and working, this PR should be good to go as well unless you have any issue with enabling this. It seems to be the only way to allow the API docs to authenticate correctly. |
seferturan
force-pushed
the
fix/readme_pkce
branch
from
August 11, 2026 12:49
a90e686 to
8e4049f
Compare
seferturan
approved these changes
Aug 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Re-Authorize / Try It OAuth flow on docs.trakt.tv fails with a generic Authorization Error popup after authorizing (refs #878). ReadMe's default authorization code exchange sends the client credentials via HTTP Basic authentication, which auth.trakt.tv does not accept, so the code-for-token exchange 400s and ReadMe surfaces the generic error.
This adds ReadMe's
oauth-optionsto the rootx-readmeblock withusePkce: true. With PKCE enabled, ReadMe replaces the client secret with a code verifier sent in the request body alongside the client_id, which is the exchange shape auth.trakt.tv supports. It also means developer client secrets never route through ReadMe.Workaround
Until the docs OAuth flow is fully restored, developers testing from the docs must add
https://docs.trakt.tv/oauth2-redirectto their app's Redirect URIs at https://app.trakt.tv/settings/apps/api. That is the callback URL ReadMe sends as theredirect_urifor the docs Try It flow, and it currently must be registered on the app for the authorize step to pass.Testing
deno task openapi:generateregenerates the spec with the newoauth-optionsblockdeno task openapi:validate,deno fmt --check, anddeno lintpass