SecuringBlazorClientSideApplications
SecuringBlazorClientSideApplications copied to clipboard
Got CORS error when calling API: when app.UseAuthorization() is placed before app.UseAuthentication()
Step to duplicate
- Run “git clone” download the project
- Open Finished sample\BethanysPieShopHRM.App.sln with Visual Studio 2019
- Set multiple startup projects (api, app, Marvin.IDP)
- Run the projects
- Login as Jack
- Click the “employeeoverview” link in NavMenu
- Got “CORS” error
Solution In API level, startup.cs replace app.UseAuthentication(); before app.UseAuthorization(); Program works fine now and able to get all employee
Thanks for noticing, that was indeed a mistake. I just fixed it in the finished solution, should work now :)