From 4e7c09bc589345c946319b42d320e2b4d8313573 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yago=20P=C3=A9rez=20V=C3=A1zquez?= Date: Sun, 12 Jan 2014 20:43:28 +0100 Subject: [PATCH] Enabling CORS support --- DurandalAuth.Web/App_Start/Startup.Auth.cs | 4 ++++ DurandalAuth.Web/DurandalAuth.Web.csproj | 6 ++++++ DurandalAuth.Web/packages.config | 2 ++ 3 files changed, 12 insertions(+) diff --git a/DurandalAuth.Web/App_Start/Startup.Auth.cs b/DurandalAuth.Web/App_Start/Startup.Auth.cs index 5507eb4..f4c3265 100644 --- a/DurandalAuth.Web/App_Start/Startup.Auth.cs +++ b/DurandalAuth.Web/App_Start/Startup.Auth.cs @@ -43,6 +43,10 @@ static Startup() public void ConfigureAuth(IAppBuilder app) { + //Enable Cors support in the Web API. Should go before the activation of Bearer tokens + //http://aspnetwebstack.codeplex.com/discussions/467315 + app.UseCors(Microsoft.Owin.Cors.CorsOptions.AllowAll); + app.UseCookieAuthentication(new CookieAuthenticationOptions()); app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie); diff --git a/DurandalAuth.Web/DurandalAuth.Web.csproj b/DurandalAuth.Web/DurandalAuth.Web.csproj index efd63b7..ba919fa 100644 --- a/DurandalAuth.Web/DurandalAuth.Web.csproj +++ b/DurandalAuth.Web/DurandalAuth.Web.csproj @@ -87,6 +87,9 @@ False ..\packages\Microsoft.Owin.2.0.2\lib\net45\Microsoft.Owin.dll + + ..\packages\Microsoft.Owin.Cors.2.0.2\lib\net45\Microsoft.Owin.Cors.dll + False ..\packages\Microsoft.Owin.Host.SystemWeb.2.0.2\lib\net45\Microsoft.Owin.Host.SystemWeb.dll @@ -152,6 +155,9 @@ ..\packages\System.Spatial.5.6.0\lib\net40\System.Spatial.dll + + ..\packages\Microsoft.AspNet.Cors.5.0.0\lib\net45\System.Web.Cors.dll + diff --git a/DurandalAuth.Web/packages.config b/DurandalAuth.Web/packages.config index 0807ded..9077ec3 100644 --- a/DurandalAuth.Web/packages.config +++ b/DurandalAuth.Web/packages.config @@ -16,6 +16,7 @@ + @@ -39,6 +40,7 @@ +