SSO login Issue with Azure AD in .net core with Angular application

P Abhishek Rao 1 Reputation point
2021-03-04T06:55:30.383+00:00

I downloaded a sample .net core code for SSO login from MS documents and did all necessary change related to Tenant and client ID. After change AAD Login is working properly. Now I have my application in .net core with angular. I did all the changes in Startup.cs and appsettings.json as instructed. But there it is not working, when I try to find out the error I found there are CORS error in console tab. After R&D I added below code to startup.cs to overcome the cors issue but it is now not solving. Please guide me to how can we workout the AAD Login (SSO) in .net core with angular application. services.

AddCors(options => { options.AddPolicy("AllowAllHeaders", builder => { builder.AllowAnyOrigin() .AllowAnyHeader() .AllowAnyMethod(); }); }); app.UseRouting(); app.UseCors("AllowAllHeaders"); //THIS HAS TO BE ADD FOR SESSION VARIABLE app.UseSession(); app.UseAuthentication(); app.UseAuthorization();

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,325 questions
{count} votes