Repository navigation
Conversation
OidcClient.setLoopbackRedirectUri lets the simulator and desktop apps sign in the way command-line tools do (RFC 8252 section 7.3): authorize() listens on 127.0.0.1, opens the user's default browser at the authorization URL, and the provider redirects the browser back to http://127.0.0.1:<port>/<path>. The provider's page runs in a real browser, so passwords, passkeys and providers that refuse embedded web views all work, and a provider that hands back by script (location.replace) completes too. - OidcLoopbackRedirect: the service-provider interface, registered through SystemBrowser.setLoopbackProvider; isLoopbackAvailable reports it. - OidcClient: the port the listener bound is the redirect in both the authorization request and the token exchange. Opt in, because some providers refuse a loopback redirect for a client registered as a mobile app; elsewhere setRedirectUri is used as before. Cancelling the returned resource closes the listener; a browser that never comes back fails with USER_CANCELLED after ten minutes. - JavaSEOidcLoopbackRedirect: a ServerSocket on 127.0.0.1 that answers the redirect with a "you can close this tab" page and 404s anything else; JavaSEPort.init registers it. - SystemBrowser's class doc no longer claims JavaSE uses the default browser. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SZMcbmyfhDCp3DQ3U1YvWh
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SZMcbmyfhDCp3DQ3U1YvWh
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SZMcbmyfhDCp3DQ3U1YvWh
Collaborator
|
Compared 12 screenshots: 12 matched. |
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
Lets the simulator and desktop apps sign in with
OidcClientthe way command-line tools do (RFC 8252, section 7.3), instead of in a popup web view. Opt in withOidcClient.setLoopbackRedirectUri("http://127.0.0.1/<path>").authorize()then works like this:127.0.0.1, on the URI's port, or on one the system picks when the URI names none.http://127.0.0.1:<port>/<path>.Because the provider's page runs in the user's own browser:
location.replace) completes too.That last case is what the popup
BrowserWindowon JavaSE could not finish (see #6404, which fixes the popup for custom-scheme redirects in the meantime).Changes
OidcLoopbackRedirect(new): the service-provider interface a port implements. It is registered throughSystemBrowser.setLoopbackProvider, andisLoopbackAvailable()reports whether there is one.OidcClient:setLoopbackRedirectUriaccepts onlyhttp://127.0.0.1orhttp://localhostwith an optional port and a path, and no query or fragment.USER_CANCELLEDafter ten minutes.setRedirectUriis used exactly as before.JavaSEOidcLoopbackRedirect(new):ServerSocketbound to127.0.0.1only.JavaSEPort.initregisters it, so the simulator and desktop builds get it. iOS and Android are unchanged.SystemBrowser: its class doc no longer claims JavaSE uses the default browser.Authentication-And-Identity.asciidoc): a short section, "Signing in through the user's own browser on the simulator and desktop".Tests
OidcLoopbackTest(core-unittests):JavaSEOidcLoopbackRedirectTest, on real sockets on127.0.0.1:scripts/pre-push-gates.sh --fullpasses locally, including SpotBugs, PMD, Checkstyle, the guide checks, Vale and the Hugo build. Left to CI: the device and screenshot suites, javadocs (JDK 25) and the guide figure check.Notes
https://claude.ai/code/session_01SZMcbmyfhDCp3DQ3U1YvWh
Generated by Claude Code