We had been using TestCafe for automated testing against our SPA from 2018 - early 2020 where we started to run into issues with MSAL 1.0 and the blocking of 3rd party cookies. We recently upgraded to our authentication packages to MSAL 2.0 in our app to overcome of the 3rd party cookie issue, but are still running into an issue with TestCafe being unable to complete the login flow. We use AAD B2C as our authentication provider. We believe the issue is related to the proxied URL when TestCafe attempts to login as the automatic redirect to the B2C login page fails as the proxied URL is not recognized within the app registration. Has anyone been able to use TestCafe using AAD B2C as an auth provider with a Angular single page app using MSAL 2.0?
Issue: TestCafe navigates to the app URL and there is no redirect to the B2C login page. This issue only exists with the proxied TestCafe traffic.
Expected behavior: Upon navigation to the base URL, the unauthenticated user should be redirect to the B2C login page and upon login redirected to the app in an authenticated state.
Environment Details: Angular 10.2.5, Angular/MSAL 2.0.2, TestCafe 1.15,
App registration as a SPA app with redirect URLS to the app base url.
Have tried with TestCafe preserveURL:true and pageCachingDisabled:true following TestCafe recommendations even though we don't believe this to be the root of the issue.
Any help is appreciated.