I am performing a task to authenticate a Active-directory B2C instance in Azure from a local ToDo WebApp using a local WebAPI service.
I have created 2 Apps App1 and App2, apart from adding a B2C instance in a trial-version subscription of Azure. In local windows 10 OS, in Visual-Studio, I collected code for the ToDo Webapp and WebAPI Service as per a Microsoft-blog here
However, when I start the WebAPI service, and run the ToDoWebapp, the login after creating a user works fine, but after that, for any call to the service, I get the error-page with the message: AuthenticationException: The remote certificate is invalid because of errors in the certificate chain: UntrustedRoot
HttpRequestException: The SSL connection could not be established, see inner exception.
How can one resolve this error?
Please check below points:
Note: Do not remove the IIS Express localhost certificate.
Try to run the following commands in .NET CLI and try again
dotnet dev-certs https --clean
dotnet dev-certs https --trust
Note: Untrusted certificates should only be used during app development. Production apps should always use valid certificates.
References:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With