I created a PCF solution which have MSAL.js login popup authentication integrated and this PCF is embedded directly inside the field service and field service mobile forms.
Now the MSAL login popup authentication work fine when we use field service in the browser. login popup opens and authentication works smoothly. but If i open the field service mobile app and open my solution, MSAL is not opening dedicated popup inside the field service mobile app instead of it opens inside the default mobile browser. That is causing the problem because after authentication it does not redirect back to the app. hence we are not able to get the access token.
What we can do here to make the MSAL.js login popup to work in inside the field service mobile app?
The same problem is also inside the Teams desktop app. when I collaborate the entityPage where I have embedded the PCF solution inside the Teams Desktop, It does not open the MSAL.js does not work and does not opens Login popup inside Teams Desktop App.If we open the teams inside the browser, It is able to open a login popup.
Alternate approach which I found out is to authenticate the user using Microsoft identity platform and the OAuth 2.0 device authorization grant flow. but I am not really sure that it is the right use case to get access token because according to the MS documentation it allows users to sign in to input-constrained devices such as a smart TV, IoT device, or printer.