fix(auth): verify external identity providers during handoff - #55
Open
michaelbrusegard wants to merge 1 commit into
Open
michaelbrusegard wants to merge 1 commit into
michaelbrusegard wants to merge 1 commit into
Conversation
Allow webmail-configured OAuth providers on separate hosts without trusting callback-supplied endpoints or broadly allowing sibling domains. Bind the client, JMAP server, issuer and token endpoint to HTTPS metadata from the selected webmail for both handoff and pairing.
Author
|
Let me know if you need anything from me to get this fix merged :) |
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.
Webmail sign-in with Pocket ID completes in the browser, but the native app rejects the handoff with
Sign-in response token endpoint is not trustedwhen the IdP is on a separate host. For example,webmail.example.comandmail.example.comdo not authorizeid.example.com. QR pairing uses the same check.This adds a fallback for providers configured by the selected webmail:
/api/configand/api/auth/oauth/metadatafrom that webmail over HTTPS, without sending the returned tokens.The existing host-based allowance and password flow are unchanged; this does not broadly trust sibling domains or change server discovery. The client-certificate transport still fails closed for external-IdP verification because its response does not expose the final URL.
Verification
main: external and sibling-host providers in both handoff and pairing. All 56 regression cases pass with the patch, including endpoint substitution, metadata mismatches, redirects, timeouts and callback-state rejection.Not tested on an Android device or emulator. The browser and network transports are mocked in the regression tests. Real Pocket ID login and subsequent token refresh still need device verification; the bundle export is not an APK or end-to-end test.
Generated by gpt-6-astra in Paseo using the Pi harness.