How does one to use BlazorWebAssembly Openid connect to Login.Gov?

328 Views Asked by At

I was struggle to figure out how to connect to login.gov. My application is a web application using MS .net 5 Blazor web Assembly. Microsoft has a package to implement OpenId and OAthe2 for Blazor Web Assembly applications. Microsoft.AspNetCore.Components.WebAssembly.Authentication hides the detailed communications between client and IDP. I'm getting the message from my browser: Access to XMLHttpRequest at 'https://idp.int.identitysandbox.gov/openid_connect/authorize/.well-known/openid-configuration' from origin 'https://localhost:44375' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. idp.int.identitysandbox.gov/openid_connect/authorize/.well-known/openid-configuration:1 Failed to load resource: net::ERR_FAILED.

1

There are 1 best solutions below

0
Anders Revsgaard On

You need login.gov to configure the https://localhost:44315 URL as an allow CORS origin.

The sample application also configured with the allow CORS origin in FoxIDs:

enter image description here