I have an angular application that connects to a net.core backend, sometimes (mostly after my tokens are due) the backend is not able to reply anymore, it gives me this error after 60 seconds and only while debugging (not happening while deployed)
> System.InvalidOperationException: IDX20803: Unable to obtain
> configuration from:
> 'https://login.microsoftonline.com/36da45f1-dd2c-4d1f-af13-5abe46b99921/v2.0/.well-known/openid-configuration'.
> Will retry at '7/24/2024 6:50:03 AM +00:00'. Exception:
> 'System.IO.IOException: IDX20804: Unable to retrieve document from:
> '[PII of type 'System.String' is hidden. For more details, see
> https://aka.ms/IdentityModel/PII.]'. --->
> System.Threading.Tasks.TaskCanceledException: The request was canceled
> due to the configured HttpClient.Timeout of 60 seconds elapsing. --->
> System.TimeoutException: A task was canceled. --->
> System.Threading.Tasks.TaskCanceledException: A task was canceled.
What is strange, is that after some/several retries, everything starts working as expected, and again when the token is due, I have the delay problem.
I’m not quite sure why this error is present, in fact the same solution I use it with a different appId from azure and the exact same code works as expected, and the configurations for tenants and audience are properly set.
Can somebody explain what is the root cause of this issue? I notized other questions with the same problem but most of them points to misconfigurations, if that were my case, then it wont work at all, and as I said, after some minutes it starts working back again for me.
thanks.