VSCode SaaS authentication broken(?) in latest AL 15.2.1630495
Please include the following with each issue:
1. Describe the bug In older AL versions, when authenticating from VSCode against a new saas tenant, we're typically prompted to open a deviicelogin URL and paste the clipboard contents for the devicelogin code into chrome, following by selecting an o365 account, after which the credentials are passed back to VS Code. this has worked fine.
AL 15.2.1630495, something has changed. instead of invoking https://microsoft.com/devicelogin, we are taken to a prompt in chrome to select an o365 account. When the relevant account is selected, it redirects to an unreachable localhost address.
2. To Reproduce Have a BC26 appsource/PTE app ready for development. stand up a BC26 saas environment. Install AL 15.2.1630495. invoke "download symbols"
you'll be greeted with this once you select an o365 account in chrome
3. Expected behavior the browser should send back the device auth token back to VS Code so it can be cached.
4. Actual behavior A clear and concise description of what happened accompanied by images, animations, or a link to a video showing the issue occurring
5. Versions:
- AL Language: 15.2.1630495
- Visual Studio Code: 1.103.0
- Business Central: 26
- List of Visual Studio Code extensions that you have installed: N/A
- Operating System:
- [X] Windows
- [ ] Linux
- [ ] MacOS
Internal work item: AB#598421
Use "al.useInteractiveLogin": false to go back to the old approach.
See #8084
thanks for the tip @mjmatthiesen . Hopefully this is resolved in AL 15.3 or newer. Agreed with issue #8084 that the default implementation is unusable without rolling back to an older AL build or using the workaround you suggested.
@mjmatthiesen your "al.useInteractiveLogin": false suggestion worked with AL 15.2. chrome still presents the same "this site can't be reached" error when redirecting back to localhost (?) after an o365 login is selected in chrome, but VSCode does pick up the credentials. So weird.
it appears that the chrome "this site can't be reached" localhost error is a red herring.
AL15.2 is passing the credentials to VSCode (regardless of the "al.useInteractiveLogin") settings. that setting also has no effect if you launch the workspace from a .code-workspace file. even with that chrome error, things work fine.
MS needs to investigate into this red herring chrome error.
I didn't experience the issue in firefox or chrome. Though the config not working with workspaces could be a thing. Once you have that config it should always prompt for device logins, but iirc, you have to restart vs code.
Will investigate the workspace issue, the setting should revert to device code auth.