Hi @Gianluca Candiotti - The flow mentioned in Microsoft Teams authentication flow for tabs is applicable for custom login providers as well.
Here are the steps:
- Provider Login button to the user. Call
microsoftTeams.authentication.authenticate()
with list of providers to choose from.microsoftTeams.authentication.authenticate({ url: window.location.origin + "/tab-auth/choose-provider", width: 600, height: 535, successCallback: function (result) { getUserProfile(result.accessToken); }, failureCallback: function (reason) { handleAuthError(reason); } });
- Provide option for user to choose from different authentication methods. See this image - authentication pop-up
- On click of selction of provider you can redirects user to respective identity provider where user can complete the login.
- Make sure to set redirect URL which is on same domain as your '/tab-auth/choose-provider' page.
- Once you are redirected after successful login you can call
microsoftTeams.authentication.notifySuccess()
with parameters like session id/ auth token. -
microsoftTeams.authentication.notifySuccess()
will close the pop-up and now you can redirect authenticated user to page of your choice.
Please let me know if you need any further help.