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.
-
CreatedDec 25, 2021
-
UpdatedDec 25, 2021
-
Views1,758
Related Articles
Blazor Bootstrap: Tooltip Component Examples
Blazor Bootstrap: Alert Component Examples
Blazor Bootstrap: Icon Component Examples
Blazor Bootstrap: Toasts Component Examples
Blazor Bootstrap: Modal Component Examples
Blazor Bootstrap: Offcanvas examples
Blazor Bootstrap: Button Examples
Blazor Bootstrap: Quick Start
How to migrate Blazor WebAssembly App to .NET 5
Blazor: How to bind employees to table / grid