fix(endpoint-auth): use publication me when signing authorization code - #913
Open
aciccarello wants to merge 1 commit into
Open
fix(endpoint-auth): use publication me when signing authorization code#913aciccarello wants to merge 1 commit into
aciccarello wants to merge 1 commit into
Conversation
Collaborator
Author
|
Created this as a draft because I still need to test this locally but my brain needs sleep... |
aciccarello
marked this pull request as ready for review
August 24, 2026 15:35
Collaborator
Author
|
Okay, I tested this and confirmed that the access token and json response contain the value from publication.me. Sparkles was able to post successfully (though it shows the original rello.me as the logged in value). Quill was able to login and shows www.ciccarello.me as the logged in user. My only remaining question is if there could be a problem if someone else set up their publication.me slightly differently (e.g. with a trailing slash) would that cause their Indiekit to stop posting and cause confusion? I wonder if this PR should get the canonical URL before setting the |
Previously, the me value supplied by the client in the authorization request was signed directly into the authorization code. If that value differed from publication.me (e.g. a redirect URL), the issued token would fail verification at query time. Per the IndieAuth spec (sections 5.2, 5.3.2, 5.3.3), the authorization server may ignore the client-supplied me and return its own canonical profile URL. publication.me is now always used when signing the code. The client-supplied me is still echoed back in the redirect response for backwards compatibility. Fixes getindiekit#911
aciccarello
force-pushed
the
fix/me-url-redirect-resolution
branch
2 times, most recently
from
August 24, 2026 16:00
959511f to
e38b315
Compare
paulrobertlloyd
force-pushed
the
main
branch
2 times, most recently
from
August 27, 2026 20:07
67b3847 to
fa1d368
Compare
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.
What
When signing the authorization code in
consent.post, always usepublication.meas themevalue instead of the client-suppliedmeparameter.Why
The IndieAuth spec allows clients to optionally pass a
meparameter in the authorization request. Indiekit was signing whatever value the client sent directly into the authorization code and subsequent access token. If that URL differed from the configuredpublication.me(e.g. because it was a redirect to the canonical URL),verifyTokenValueswould reject the token at query time, causing authentication to silently fail.The IndieAuth spec explicitly permits this approach: section 5.2 says the authorization endpoint *MAY* ignore the client-supplied
meentirely, and sections 5.3.2 and 5.3.3 note the returnedme*MAY* differ from the URL the client provided, giving the server an opportunity to canonicalize it.The client-supplied
meis still echoed in the redirect response for backwards compatibility with older clients.Changes
packages/endpoint-auth/lib/controllers/consent.js: usepublication.mewhen signing the authorization codepackages/endpoint-auth/test/integration/302-consent-submit-authenticate-with-me.js: updated to use a mismatchedmevalue and assertpublication.meis in the signed codepackages/endpoint-auth/test/integration/302-consent-submit-authenticate.js: updated to assertpublication.meis used when nomeparam is suppliedFixes #911