I'm working on a Business Central extension, and its job is to help users provision their BC company in an external service. The desired flow looks like:
1) User installs an extension and opens a setup wizard
2) The user clicks the "Login" button and is redirected to an external authentication server (not Entra), where they log in using their credentials (Microsoft, Google, etc.) for the external web service.
3) Extension got back its access token and performs an API call to the external web service to provision the BC company there.
How to implement such a flow? I saw only tutorials about how to get access from an external service to Business Central, but not vice versa.