Support usage over ssh?
theoparis opened this issue ยท 6 comments
After uninstalling w3m xdg-open finally prints the login URL for microsoft auth, but it then tries to open localhost:.../code which won't work remotely. Is there a solution to this? Does microsoft's oauth2 even support this?
Would it be possible to manually paste the authentication code in the terminal, if the response can't be received via the localhost http server?
Yeah that should work.
This is more annoying than I first thought, because giving the initial URL is possible, therefore how to get the response token ? Because Microsoft auth page will redirect anyway to a localhost page that will not be able to load, but response parameters are given as post form, so it would be really annoying for user to copy code/token to the terminal.
I always felt that this web browser thing was a mistake, and I'm wondering if https://github.com/AzureAD/microsoft-authentication-library-for-python could be useful to implement the authentication in terminal.
I've found a good workaround, I'll use a publicly hosted page (on my website) that will only forward the request to the local launcher. If the local launcher did not find a web browser or the --auth-no-browser
then the url is printed, and you just need to go in your web browser. Then you are redirected to my website, and you can paste the code in the terminal. This also fixed a long-running problem with the local http server being on a fixed port, now the port is dynamically allocated.
For those interested in the script, this will be this page, and the MS auth page will put query string as fragment, so it is never sent to my server. https://www.theorozier.fr/portablemc/auth
Release 4.2.1, containing the new authentication mechanism (I hope everything works fine!)