Closed akshaybabloo closed 3 years ago
@akshaybabloo Can you confirm whether you are using the MsalRedirectComponent
in your app? I haven't been able to reproduce your error.
Yes and it's in the bootstrap
property.
@akshaybabloo I was able to reproduce the behavior you stated, and it appears to be an issue with using HTML templating and impure pipes, instead of with MSAL. It seems that the recommended approach according to the Angular docs with using http requests with pipes is to cache the server response, to prevent performance problems. Please take a look at the docs for an approach that may mitigate your problem. Alternatively, we would recommend continuing to use the code above in the OnInit()
instead of in the HTML template.
Got it @jo-arroyo
Thanks for your help.
Library
@azure/msal-angular@2.x.x
Framework
Description
Let's say I have a service API something like this:
Now I have injected the above service in
Dashboard
module/component, something like this:The above code works fine. But when I remove the code from
ngOnInit()
and call the injected service in the HTML page as -<p>{{dashboardApiService.getAllClients() | async | json}}</p>
The page goes to loading state, and there are 1000s of requests to
https://gollahalliauth.b2clogin.com/gollahalliauth.onmicrosoft.com/b2c_1_signupsigninflow/v2.0/.well-known/openid-configuration
Error Message
And I get 1000s of log output as:
MSAL Configuration
The configuration is similar to B2C example at https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-angular-v2-samples/angular11-b2c-sample
Reproduction steps
Dashboard
app-routing.module.ts
<p>{{dashboardApiService.getAllClients() | async | json}}</p>
Expected behavior
You should see a JSON output in the HTML page
Identity Provider
Browsers/Environment
Regression
Security
Source