Skip to content

Commit

Permalink
Enabling CORS support
Browse files Browse the repository at this point in the history
  • Loading branch information
yagopv committed Jan 12, 2014
1 parent 2b4b45f commit 4e7c09b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions DurandalAuth.Web/App_Start/Startup.Auth.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
6 changes: 6 additions & 0 deletions DurandalAuth.Web/DurandalAuth.Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Microsoft.Owin.2.0.2\lib\net45\Microsoft.Owin.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Owin.Cors">
<HintPath>..\packages\Microsoft.Owin.Cors.2.0.2\lib\net45\Microsoft.Owin.Cors.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Owin.Host.SystemWeb, Version=2.0.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Microsoft.Owin.Host.SystemWeb.2.0.2\lib\net45\Microsoft.Owin.Host.SystemWeb.dll</HintPath>
Expand Down Expand Up @@ -152,6 +155,9 @@
<Reference Include="System.Spatial, Version=5.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\System.Spatial.5.6.0\lib\net40\System.Spatial.dll</HintPath>
</Reference>
<Reference Include="System.Web.Cors">
<HintPath>..\packages\Microsoft.AspNet.Cors.5.0.0\lib\net45\System.Web.Cors.dll</HintPath>
</Reference>
<Reference Include="System.Web.DynamicData" />
<Reference Include="System.Web.Entity" />
<Reference Include="System.Web.ApplicationServices" />
Expand Down
2 changes: 2 additions & 0 deletions DurandalAuth.Web/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<package id="jQuery" version="2.0.3" targetFramework="net451" />
<package id="Knockout.Validation" version="1.0.1" targetFramework="net451" />
<package id="knockoutjs" version="3.0.0" targetFramework="net451" />
<package id="Microsoft.AspNet.Cors" version="5.0.0" targetFramework="net451" />
<package id="Microsoft.AspNet.Identity.Core" version="1.0.0" targetFramework="net451" />
<package id="Microsoft.AspNet.Identity.EntityFramework" version="1.0.0" targetFramework="net451" />
<package id="Microsoft.AspNet.Identity.Owin" version="1.0.0" targetFramework="net451" />
Expand All @@ -39,6 +40,7 @@
<package id="Microsoft.Data.Edm" version="5.6.0" targetFramework="net451" />
<package id="Microsoft.Data.OData" version="5.6.0" targetFramework="net451" />
<package id="Microsoft.Owin" version="2.0.2" targetFramework="net451" />
<package id="Microsoft.Owin.Cors" version="2.0.2" targetFramework="net451" />
<package id="Microsoft.Owin.Host.SystemWeb" version="2.0.2" targetFramework="net451" />
<package id="Microsoft.Owin.Security" version="2.0.2" targetFramework="net451" />
<package id="Microsoft.Owin.Security.Cookies" version="2.0.2" targetFramework="net451" />
Expand Down

0 comments on commit 4e7c09b

Please sign in to comment.