create
fun create(port: Int, path: String, browserLauncher: Consumer<String>): LocalhostBrowserRedirectHandler
Creates a LocalhostBrowserRedirectHandler with a Java-friendly java.util.function.Consumer browser launcher.
Java usage:
LocalhostBrowserRedirectHandler handler =
LocalhostBrowserRedirectHandler.create(8080, "/callback", url -> myBrowser.open(url));Content copied to clipboard
Return
Parameters
port
the port to listen on.
path
the expected callback path.
browserLauncher
a Consumer that opens the given URL in a browser.
fun create(port: Int, path: String, timeoutMs: Long, successResponse: String, browserLauncher: Consumer<String>): LocalhostBrowserRedirectHandler
Creates a LocalhostBrowserRedirectHandler with a custom timeout and Java-friendly java.util.function.Consumer browser launcher.
Return
Parameters
port
the port to listen on.
path
the expected callback path.
timeoutMs
maximum wait time in milliseconds.
successResponse
raw HTTP response written back to the browser on success.
browserLauncher
a Consumer that opens the given URL in a browser.