Recommend PKCE and deprecate the client secret - #974
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b2c8322e5a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Addressed all three Codex points, each folded into its origin commit:
Pushed as d785eb7. Portal check, 335 tests, and build green; api lint and publish dry run green; OpenAPI validates. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d785eb7b64
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
PKCE is now the recommended way to sign users in, and the Client Secret is deprecated for anything but server-to-server calls. - Add code_challenge and code_challenge_method to the authorize and device code requests, and code_verifier to the token and device token requests. - Make client_secret optional and deprecated on every /oauth body (token, refresh, device token, revoke), from one shared schema. - Add a note to every /oauth endpoint description pointing to the PKCE guide, and drop client_secret from the request tables.
Enforcing PKCE as the default makes a copied Client ID useless, so the portal now steers developers to it. - Add a PKCE guide at /docs/pkce, covering both the authorization code and device code flows, and link it from Authentication and Create an App. - Show a PKCE recommendation next to the Client Secret on the app page and mark the secret deprecated. When the API stops returning a secret, show a placeholder instead of an empty value. - Warn on the app page and in the app form when a redirect URI is not a public https:// address (custom schemes, http, localhost, out-of-band). - Leave deprecated fields out of generated request body samples, so client_secret no longer appears in the /oauth samples.
A missing PUBLIC_GITHUB_CLIENT_ID made the static env import fail, so the apps page returned a 500 in local dev. Read it from the dynamic public env instead, and disable the Connect GitHub buttons with a note when it is not set.
vladjerca
left a comment
There was a problem hiding this comment.
Validated the corrected OAuth contract and developer documentation: OpenAPI validation, API lint and publish dry run, plus developer formatting, type-check, build, and 335 tests all pass. The public documentation now matches the supported flows.
Reset your local branch before pushing again.
Summary
Makes PKCE the recommended way to sign users in to Trakt, and starts phasing out the Client Secret for anything but server-to-server calls. With PKCE as the default, a copied Client ID can no longer be turned into tokens.
API reference (
@trakt/api)code_challengeandcode_challenge_methodon authorize, andcode_verifieron token.client_secretis now optional and marked deprecated on every/oauthbody (token, refresh, device token, revoke), from one shared schema.client_secretis removed from request tables.Developer portal
https://address (custom schemes,http://, localhost, out-of-band). Mobile apps are pointed to Universal Links and verified App Links. It warns but does not block saving.client_secretno longer appears in the/oauthsamples.PUBLIC_GITHUB_CLIENT_IDis not set. Connect GitHub is disabled with a note instead. The ID is now read from the dynamic public env, which the static build writes to/_app/env.js. @vladjerca feel free to revert that commit, I just needed that to test locally 👨🔬Notes for reviewers
@trakt/apichange needs a version tag to publish.Test plan
deno task check,deno task test(325 passing),deno task build, and both format checks inprojects/developerdeno fmt --check,deno lint, anddeno task publish:checkinprojects/apideno task openapi:validate/docs/pkcerenders and shows in the sidebarpostOauthTokensample body has noclient_secret, and the note renders on the/oauthendpoints/appsloads withoutPUBLIC_GITHUB_CLIENT_IDLocal testing screenshots