← Back to list

Solve CORS problem with web api .NET with OWIN aut

Install the package Microsoft.AspNet.WebApi.Cors

Sara Ahsain · 2022-01-19 14:16 · 2 claps · 0.2 min read
#dotnet #owin #cors #authentication #api
Open on Medium ↗

Solve CORS problem with web api .NET with OWIN authentication

  • Install the package Microsoft.AspNet.WebApi.Cors
  • Add in Startup.cs: app.UseCors(Microsoft.Owin.Cors.CorsOptions.AllowAll);
  • Do not add in SimpleAuthorizationServerProvider.cs: context.OwinContext.Response.Headers.Add(“Access-Control-Allow-Origin”, new[] { “*” });

In case the problem still persists

  • Add in Startup.Auth.cs: app.UseCors(Microsoft.Owin.Cors.CorsOptions.AllowAll);

메타데이터
post_id
f2e32743c712
slug
solve-cors-problem-with-web-api-net-with-owin-aut-f2e32743c712
url
https://medium.com/@saraahsain/solve-cors-problem-with-web-api-net-with-owin-aut-f2e32743c712
canonical_url
https://medium.com/@saraahsain/solve-cors-problem-with-web-api-net-with-owin-aut-f2e32743c712
author_url
https://medium.com/@saraahsain
status
ok
fetched_at
2026-07-27 14:54:31