iosreactjsazure-ad-b2cprogressive-web-appspwabuilder

Azure B2C integration not working on app built using pwabuilder for iOS


I have built a PWA using ReactJS, which integrates with Azure B2C for register/sign in using MSAL library. I have built the package for google play store using pwabuilder and I was successfully able to publish it to Google Play Store, all the functionalities are also working fine.

I have recently built the package for iOS as well using pwabuilder, package has been successfully built and I was able to upload it to apple store as well but the integration with Azure B2C is not working. When I download my PWA as web app in my iPhone, it works fine but not working in pwabuilder package version.

On clicking the button to open Azure B2C user flow, pwabuilder package redirect to page which shows my app icon and offline wifi icon, after couple of seconds it redirects me to homepage. Ideally the user should be redirect to Azure B2C register/sign in page.

enter image description here

I have tried to debug that in iOS simulator and using proxyman tried to view APIs called. I have observed one difference, in case of pwa msal integration calls .wellknown followed by authorize API whereas in the pwabuilder package built it is calling .wellknown endpoint only. Client is com.apple.webkit.networking

I am expecting the behavior of package built using pwabuilder should behave similar as pwa for Azure b2c integration.


Solution

  • You need to add azure b2c domains chain as AuthDomains in Settings and into Info.plist, make sure you are using redirection to open b2c and not popup.