I'm building an extension which utilizes the PKCE OAuth flow. This means I need to launch out of Intellij and into a browser for sign-on activities, and then redirect back into the IDE to complete the sign-on.
I am able to complete the first step without any issue.
For the second step I need to redirect back from the browser to the IDE - currently I have created a RestService and registered this in the plugin.xml. When I install the plugin manually, I can hit the endpoint. The intension was to call this endpoint as part of the PKCE redirect URL.
However, I would like to redirect back to and regain focus with the IDE (specifically the window that originally launched the browser).
In VSCode this is possible by prefixing the redirect URL with vscode://urlhandleruri and registering a URI handler with a specific authority (the authority is used to determine which instance of VSCode to redirect into).
The browser uses the vscode:// prefix to launch the application, and then the application uses the provided authority to determine which IDE window to focus on.
Can this be recreated in Intellij somehow? Can I launch Intellij from the URL bar within the browser using something like jetbrains://idea/...?