Fixed: Blazor Webassembly - Google Authentication Issue - Access to XMLHttpRequest at 'https://login.microsoftonline.com/.well-known/openid-configuration' from origin 'https://localhost:7215' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

I have created the Blazor WebAssesmbly App project with Google (Individual User Accounts) authentication. When I try to log in, I'm getting the below error.

Error:

Access to XMLHttpRequest at 'https://login.microsoftonline.com/.well-known/openid-configuration' from origin 'https://localhost:7215' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

GET https://login.microsoftonline.com/.well-known/openid-configuration net::ERR_FAILED 404

Screenshot:

Program.cs

appsettings.json

Solution:

Change the bind key from Local to Google or other.

Program.cs after changes

appsettings.json after changes

I hope this will help other developers.