I am trying to access secure my angular2 application with api using identityserver.
I am following the steps mentioned in SPA Authentication using OpenID Connect, Angular CLI and oidc-client
I am getting the following error. On the server side, i have added the following to enable cors:
new Client{
.....,
AllowedCorsOrigins = new List<string>
{
"http://localhost:4200"
}
}
Failed to load https://localhost:44300/identity/.well-known/openid-configuration: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Origin 'http://localhost:4200' is therefore not allowed access.
Can anyone please help to solve this?
Thanks