Skip to content
Browse files

Implemented the HttpHeaderAntiForgeryAttribute

1.- HttpHeaderAntiForgeryTokenAttribute
2.- Substituted the SimplePostVariableParameterBindingAttribute
  • Loading branch information...
1 parent d1dfa17 commit 29482fe89fd04b7e5c7b35c1fe83966935b477d5 @rmbrunet rmbrunet committed Jan 28, 2013
View
BIN MVC4/PersonaMVC4Example/App_Data/aspnet-PersonaMVC4Example-20120928074626.mdf
Binary file not shown.
View
BIN MVC4/PersonaMVC4Example/App_Data/aspnet-PersonaMVC4Example-20120928074626_log.ldf
Binary file not shown.
View
178 MVC4/PersonaMVC4Example/Controllers/PersonaController.cs
@@ -1,90 +1,88 @@
-using Microsoft.Web.WebPages.OAuth;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Linq;
-using PersonaMVC4Example.Models;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Net;
-using System.Net.Http;
-using System.Threading.Tasks;
-using System.Web;
-using System.Web.Http;
-using System.Web.Security;
-using WebMatrix.WebData;
-
-namespace PersonaMVC4Example.Controllers
-{
- [SimplePostVariableParameterBinding]
- public class PersonaController : ApiController
- {
- // POST api/persona
- [HttpPost][ActionName("login")]
- public async Task<HttpResponseMessage> Login(string assertion)
- {
- if (assertion == null)
- {
- return new HttpResponseMessage(HttpStatusCode.BadRequest);
- }
- var cookies = Request.Headers.GetCookies();
- string token = cookies[0]["__RequestVerificationToken"].Value;
- //TODO What do I do with this?
-
- using (var client = new HttpClient())
- {
- var content = new FormUrlEncodedContent(
- new Dictionary<string, string> {
- { "assertion", assertion },
- { "audience", Request.Url.Host },
- }
- );
- var result = await client.PostAsync("https://verifier.login.persona.org/verify", content);
- var stringresult = await result.Content.ReadAsStringAsync();
- dynamic jsonresult = JsonConvert.DeserializeObject<dynamic>(stringresult);
- if (jsonresult.status == "okay")
- {
- string email = jsonresult.email;
-
- string userName = null;
- if (User.Identity.IsAuthenticated)
- {
- userName = User.Identity.Name;
- }
- else
- {
- userName = OAuthWebSecurity.GetUserName("Persona", email);
- if (userName == null)
- {
- userName = email; // TODO: prompt for user name
- using (UsersContext db = new UsersContext())
- {
- UserProfile user = db.UserProfiles.FirstOrDefault(u => u.UserName.ToLower() == userName.ToLower());
- // Check if user already exists
- if (user == null)
- {
- // Insert name into the profile table
- db.UserProfiles.Add(new UserProfile { UserName = userName });
- db.SaveChanges();
-
- }
- }
- }
- }
-
- OAuthWebSecurity.CreateOrUpdateAccount("Persona", email, userName);
-
-
- FormsAuthentication.SetAuthCookie(email, false);
- return new HttpResponseMessage(HttpStatusCode.OK);
- }
- }
- return new HttpResponseMessage(HttpStatusCode.Forbidden);
- }
-
- [HttpPost][ActionName("logout")]
- public void Logout()
- {
- WebSecurity.Logout();
- }
- }
-}
+using Microsoft.Web.WebPages.OAuth;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+using PersonaMVC4Example.Models;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net;
+using System.Net.Http;
+using System.Threading.Tasks;
+using System.Web;
+using System.Web.Http;
+using System.Web.Security;
+using WebMatrix.WebData;
+
+namespace PersonaMVC4Example.Controllers
+{
+ //[SimplePostVariableParameterBinding]
+ [HttpHeaderAntiForgeryTokenAttribute]
+ public class PersonaController : ApiController
+ {
+ // POST api/persona
+ [HttpPost][ActionName("login")]
+ public async Task<HttpResponseMessage> Login([FromBody] string assertion)
+ {
+ if (assertion == null)
+ {
+ return new HttpResponseMessage(HttpStatusCode.BadRequest);
+ }
+
+ using (var client = new HttpClient())
+ {
+ var content = new FormUrlEncodedContent(
+ new Dictionary<string, string> {
+ { "assertion", assertion },
+ { "audience", HttpContext.Current.Request.Url.Host },
+ }
+ );
+ var result = await client.PostAsync("https://verifier.login.persona.org/verify", content);
+ var stringresult = await result.Content.ReadAsStringAsync();
+ dynamic jsonresult = JsonConvert.DeserializeObject<dynamic>(stringresult);
+ if (jsonresult.status == "okay")
+ {
+ string email = jsonresult.email;
+
+ string userName = null;
+ if (User.Identity.IsAuthenticated)
+ {
+ userName = User.Identity.Name;
+ }
+ else
+ {
+ userName = OAuthWebSecurity.GetUserName("Persona", email);
+ if (userName == null)
+ {
+ userName = email; // TODO: prompt for user name
+ using (UsersContext db = new UsersContext())
+ {
+ UserProfile user = db.UserProfiles.FirstOrDefault(u => u.UserName.ToLower() == userName.ToLower());
+ // Check if user already exists
+ if (user == null)
+ {
+ // Insert name into the profile table
+ db.UserProfiles.Add(new UserProfile { UserName = userName });
+ db.SaveChanges();
+
+ }
+ }
+ }
+ }
+
+ OAuthWebSecurity.CreateOrUpdateAccount("Persona", email, userName);
+
+
+ FormsAuthentication.SetAuthCookie(email, false);
+ return new HttpResponseMessage(HttpStatusCode.OK);
+ }
+ }
+ return new HttpResponseMessage(HttpStatusCode.Forbidden);
+ }
+
+ [HttpPost][ActionName("logout")]
+ public void Logout()
+ {
+ WebSecurity.Logout();
+ }
+ }
+}
View
37 MVC4/PersonaMVC4Example/Filters/HttpHeaderAntiforgeryTokenAttribute.cs
@@ -0,0 +1,37 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Net.Http; //HttpRequestMessageExtensions
+using System.Net.Http.Headers;
+using System.Web.Helpers;
+using System.Web.Http;
+using System.Net;
+using System.Web.Mvc;
+
+namespace PersonaMVC4Example {
+ public class HttpHeaderAntiForgeryTokenAttribute : System.Web.Http.Filters.AuthorizationFilterAttribute {
+ static string _tokenKey = AntiForgeryConfig.CookieName;
+
+ public override void OnAuthorization(System.Web.Http.Controllers.HttpActionContext actionContext) {
+ if (actionContext == null) {
+ throw new ArgumentNullException("actionContext");
+ }
+
+ try {
+
+ CookieHeaderValue cookie = actionContext.Request.Headers.GetCookies(_tokenKey).FirstOrDefault();
+ var cookieToken = cookie != null ? cookie[_tokenKey].Value : null;
+
+ string headerToken = actionContext.Request.Headers.GetValues(_tokenKey).First();
+ System.Web.Helpers.AntiForgery.Validate(cookieToken, headerToken); // Will throw HttpAntiForgeryException
+ }
+ catch {
+ actionContext.Response = new HttpResponseMessage(System.Net.HttpStatusCode.BadRequest) {
+ Content = new StringContent("Invalid or Missing AntiForgery Token")
+ };
+ }
+ return;
+ }
+ }
+}
View
667 MVC4/PersonaMVC4Example/PersonaMVC4Example.csproj
@@ -1,334 +1,335 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>
- </ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{38A68603-BC0F-4955-A4BD-B9E14BC72A0F}</ProjectGuid>
- <ProjectTypeGuids>{E3E379DF-F4C6-4180-9B81-6769533ABE47};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>PersonaMVC4Example</RootNamespace>
- <AssemblyName>PersonaMVC4Example</AssemblyName>
- <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
- <MvcBuildViews>false</MvcBuildViews>
- <UseIISExpress>true</UseIISExpress>
- <IISExpressSSLPort />
- <IISExpressAnonymousAuthentication />
- <IISExpressWindowsAuthentication />
- <IISExpressUseClassicPipelineMode />
- <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
- <RestorePackages>true</RestorePackages>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="Microsoft.CSharp" />
- <Reference Include="System" />
- <Reference Include="System.Data" />
- <Reference Include="System.Data.Entity" />
- <Reference Include="System.Drawing" />
- <Reference Include="System.Web.DynamicData" />
- <Reference Include="System.Web.Entity" />
- <Reference Include="System.Web.ApplicationServices" />
- <Reference Include="System.ComponentModel.DataAnnotations" />
- <Reference Include="System.Core" />
- <Reference Include="System.Data.DataSetExtensions" />
- <Reference Include="System.Xml.Linq" />
- <Reference Include="System.Web" />
- <Reference Include="System.Web.Extensions" />
- <Reference Include="System.Web.Abstractions" />
- <Reference Include="System.Web.Routing" />
- <Reference Include="System.Xml" />
- <Reference Include="System.Configuration" />
- <Reference Include="System.Transactions" />
- <Reference Include="System.Web.Services" />
- <Reference Include="System.EnterpriseServices" />
- <Reference Include="EntityFramework">
- <HintPath>..\packages\EntityFramework.5.0.0\lib\net45\EntityFramework.dll</HintPath>
- </Reference>
- <Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
- <Private>True</Private>
- <HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
- </Reference>
- <Reference Include="Newtonsoft.Json">
- <HintPath>..\packages\Newtonsoft.Json.4.5.6\lib\net40\Newtonsoft.Json.dll</HintPath>
- </Reference>
- <Reference Include="System.Net.Http">
- </Reference>
- <Reference Include="System.Net.Http.Formatting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
- <HintPath>..\packages\Microsoft.AspNet.WebApi.Client.4.0.20710.0\lib\net40\System.Net.Http.Formatting.dll</HintPath>
- </Reference>
- <Reference Include="System.Net.Http.WebRequest">
- </Reference>
- <Reference Include="System.Web.Helpers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
- <Private>True</Private>
- <HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.Helpers.dll</HintPath>
- </Reference>
- <Reference Include="System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
- <HintPath>..\packages\Microsoft.AspNet.WebApi.Core.4.0.20710.0\lib\net40\System.Web.Http.dll</HintPath>
- </Reference>
- <Reference Include="System.Web.Http.WebHost, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
- <HintPath>..\packages\Microsoft.AspNet.WebApi.WebHost.4.0.20710.0\lib\net40\System.Web.Http.WebHost.dll</HintPath>
- </Reference>
- <Reference Include="System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
- <Private>True</Private>
- <HintPath>..\packages\Microsoft.AspNet.Mvc.4.0.20710.0\lib\net40\System.Web.Mvc.dll</HintPath>
- </Reference>
- <Reference Include="System.Web.Optimization">
- <HintPath>..\packages\Microsoft.AspNet.Web.Optimization.1.0.0\lib\net40\System.Web.Optimization.dll</HintPath>
- </Reference>
- <Reference Include="System.Web.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
- <Private>True</Private>
- <HintPath>..\packages\Microsoft.AspNet.Razor.2.0.20710.0\lib\net40\System.Web.Razor.dll</HintPath>
- </Reference>
- <Reference Include="System.Web.WebPages, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
- <Private>True</Private>
- <HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.WebPages.dll</HintPath>
- </Reference>
- <Reference Include="System.Web.WebPages.Deployment, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
- <Private>True</Private>
- <HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.WebPages.Deployment.dll</HintPath>
- </Reference>
- <Reference Include="System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
- <Private>True</Private>
- <HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.WebPages.Razor.dll</HintPath>
- </Reference>
- <Reference Include="WebMatrix.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
- <Private>True</Private>
- <HintPath>..\packages\Microsoft.AspNet.WebPages.Data.2.0.20710.0\lib\net40\WebMatrix.Data.dll</HintPath>
- </Reference>
- <Reference Include="Microsoft.Web.WebPages.OAuth, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
- <Private>True</Private>
- <HintPath>..\packages\Microsoft.AspNet.WebPages.OAuth.2.0.20710.0\lib\net40\Microsoft.Web.WebPages.OAuth.dll</HintPath>
- </Reference>
- <Reference Include="WebMatrix.WebData, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
- <Private>True</Private>
- <HintPath>..\packages\Microsoft.AspNet.WebPages.WebData.2.0.20710.0\lib\net40\WebMatrix.WebData.dll</HintPath>
- </Reference>
- <Reference Include="DotNetOpenAuth.AspNet, Version=4.0.0.0, Culture=neutral, PublicKeyToken=2780ccd10d57b246, processorArchitecture=MSIL">
- <Private>True</Private>
- <HintPath>..\packages\DotNetOpenAuth.AspNet.4.0.3.12153\lib\net40-full\DotNetOpenAuth.AspNet.dll</HintPath>
- </Reference>
- <Reference Include="DotNetOpenAuth.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=2780ccd10d57b246, processorArchitecture=MSIL">
- <Private>True</Private>
- <HintPath>..\packages\DotNetOpenAuth.Core.4.0.3.12153\lib\net40-full\DotNetOpenAuth.Core.dll</HintPath>
- </Reference>
- <Reference Include="DotNetOpenAuth.OAuth.Consumer, Version=4.0.0.0, Culture=neutral, PublicKeyToken=2780ccd10d57b246, processorArchitecture=MSIL">
- <Private>True</Private>
- <HintPath>..\packages\DotNetOpenAuth.OAuth.Consumer.4.0.3.12153\lib\net40-full\DotNetOpenAuth.OAuth.Consumer.dll</HintPath>
- </Reference>
- <Reference Include="DotNetOpenAuth.OAuth, Version=4.0.0.0, Culture=neutral, PublicKeyToken=2780ccd10d57b246, processorArchitecture=MSIL">
- <Private>True</Private>
- <HintPath>..\packages\DotNetOpenAuth.OAuth.Core.4.0.3.12153\lib\net40-full\DotNetOpenAuth.OAuth.dll</HintPath>
- </Reference>
- <Reference Include="DotNetOpenAuth.OpenId, Version=4.0.0.0, Culture=neutral, PublicKeyToken=2780ccd10d57b246, processorArchitecture=MSIL">
- <Private>True</Private>
- <HintPath>..\packages\DotNetOpenAuth.OpenId.Core.4.0.3.12153\lib\net40-full\DotNetOpenAuth.OpenId.dll</HintPath>
- </Reference>
- <Reference Include="DotNetOpenAuth.OpenId.RelyingParty, Version=4.0.0.0, Culture=neutral, PublicKeyToken=2780ccd10d57b246, processorArchitecture=MSIL">
- <Private>True</Private>
- <HintPath>..\packages\DotNetOpenAuth.OpenId.RelyingParty.4.0.3.12153\lib\net40-full\DotNetOpenAuth.OpenId.RelyingParty.dll</HintPath>
- </Reference>
- <Reference Include="WebGrease">
- <Private>True</Private>
- <HintPath>..\packages\WebGrease.1.1.0\lib\WebGrease.dll</HintPath>
- </Reference>
- <Reference Include="Antlr3.Runtime">
- <Private>True</Private>
- <HintPath>..\packages\WebGrease.1.1.0\lib\Antlr3.Runtime.dll</HintPath>
- </Reference>
- </ItemGroup>
- <ItemGroup>
- <Compile Include="App_Start\AuthConfig.cs" />
- <Compile Include="App_Start\BundleConfig.cs" />
- <Compile Include="App_Start\FilterConfig.cs" />
- <Compile Include="App_Start\RouteConfig.cs" />
- <Compile Include="App_Start\WebApiConfig.cs" />
- <Compile Include="Controllers\AccountController.cs" />
- <Compile Include="Controllers\HomeController.cs" />
- <Compile Include="Controllers\PersonaController.cs" />
- <Compile Include="Filters\InitializeSimpleMembershipAttribute.cs" />
- <Compile Include="Global.asax.cs">
- <DependentUpon>Global.asax</DependentUpon>
- </Compile>
- <Compile Include="Helpers\PersonaAuthenticationClient.cs" />
- <Compile Include="ModelBinders\SimplePostVariableParameterBinding.cs" />
- <Compile Include="ModelBinders\SimplePostVariableParameterBindingAttribute.cs" />
- <Compile Include="Models\AccountModels.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- </ItemGroup>
- <ItemGroup>
- <Content Include="Content\persona-buttons.css" />
- <Content Include="Content\themes\base\images\ui-bg_flat_0_aaaaaa_40x100.png" />
- <Content Include="Content\themes\base\images\ui-bg_flat_75_ffffff_40x100.png" />
- <Content Include="Content\themes\base\images\ui-bg_glass_55_fbf9ee_1x400.png" />
- <Content Include="Content\themes\base\images\ui-bg_glass_65_ffffff_1x400.png" />
- <Content Include="Content\themes\base\images\ui-bg_glass_75_dadada_1x400.png" />
- <Content Include="Content\themes\base\images\ui-bg_glass_75_e6e6e6_1x400.png" />
- <Content Include="Content\themes\base\images\ui-bg_glass_95_fef1ec_1x400.png" />
- <Content Include="Content\themes\base\images\ui-bg_highlight-soft_75_cccccc_1x100.png" />
- <Content Include="Content\themes\base\images\ui-icons_222222_256x240.png" />
- <Content Include="Content\themes\base\images\ui-icons_2e83ff_256x240.png" />
- <Content Include="Content\themes\base\images\ui-icons_454545_256x240.png" />
- <Content Include="Content\themes\base\images\ui-icons_888888_256x240.png" />
- <Content Include="Content\themes\base\images\ui-icons_cd0a0a_256x240.png" />
- <Content Include="Content\themes\base\jquery-ui.css" />
- <Content Include="Content\themes\base\jquery.ui.accordion.css" />
- <Content Include="Content\themes\base\jquery.ui.all.css" />
- <Content Include="Content\themes\base\jquery.ui.autocomplete.css" />
- <Content Include="Content\themes\base\jquery.ui.base.css" />
- <Content Include="Content\themes\base\jquery.ui.button.css" />
- <Content Include="Content\themes\base\jquery.ui.core.css" />
- <Content Include="Content\themes\base\jquery.ui.datepicker.css" />
- <Content Include="Content\themes\base\jquery.ui.dialog.css" />
- <Content Include="Content\themes\base\jquery.ui.progressbar.css" />
- <Content Include="Content\themes\base\jquery.ui.resizable.css" />
- <Content Include="Content\themes\base\jquery.ui.selectable.css" />
- <Content Include="Content\themes\base\jquery.ui.slider.css" />
- <Content Include="Content\themes\base\jquery.ui.tabs.css" />
- <Content Include="Content\themes\base\jquery.ui.theme.css" />
- <Content Include="Content\themes\base\minified\images\ui-bg_flat_0_aaaaaa_40x100.png" />
- <Content Include="Content\themes\base\minified\images\ui-bg_flat_75_ffffff_40x100.png" />
- <Content Include="Content\themes\base\minified\images\ui-bg_glass_55_fbf9ee_1x400.png" />
- <Content Include="Content\themes\base\minified\images\ui-bg_glass_65_ffffff_1x400.png" />
- <Content Include="Content\themes\base\minified\images\ui-bg_glass_75_dadada_1x400.png" />
- <Content Include="Content\themes\base\minified\images\ui-bg_glass_75_e6e6e6_1x400.png" />
- <Content Include="Content\themes\base\minified\images\ui-bg_glass_95_fef1ec_1x400.png" />
- <Content Include="Content\themes\base\minified\images\ui-bg_highlight-soft_75_cccccc_1x100.png" />
- <Content Include="Content\themes\base\minified\images\ui-icons_222222_256x240.png" />
- <Content Include="Content\themes\base\minified\images\ui-icons_2e83ff_256x240.png" />
- <Content Include="Content\themes\base\minified\images\ui-icons_454545_256x240.png" />
- <Content Include="Content\themes\base\minified\images\ui-icons_888888_256x240.png" />
- <Content Include="Content\themes\base\minified\images\ui-icons_cd0a0a_256x240.png" />
- <Content Include="Content\themes\base\minified\jquery-ui.min.css" />
- <Content Include="Content\themes\base\minified\jquery.ui.accordion.min.css" />
- <Content Include="Content\themes\base\minified\jquery.ui.autocomplete.min.css" />
- <Content Include="Content\themes\base\minified\jquery.ui.button.min.css" />
- <Content Include="Content\themes\base\minified\jquery.ui.core.min.css" />
- <Content Include="Content\themes\base\minified\jquery.ui.datepicker.min.css" />
- <Content Include="Content\themes\base\minified\jquery.ui.dialog.min.css" />
- <Content Include="Content\themes\base\minified\jquery.ui.progressbar.min.css" />
- <Content Include="Content\themes\base\minified\jquery.ui.resizable.min.css" />
- <Content Include="Content\themes\base\minified\jquery.ui.selectable.min.css" />
- <Content Include="Content\themes\base\minified\jquery.ui.slider.min.css" />
- <Content Include="Content\themes\base\minified\jquery.ui.tabs.min.css" />
- <Content Include="Content\themes\base\minified\jquery.ui.theme.min.css" />
- <Content Include="favicon.ico" />
- <Content Include="Global.asax" />
- <None Include="Scripts\jquery-1.7.1.intellisense.js" />
- <Content Include="Images\personasinginbutton.png" />
- <Content Include="Scripts\jquery-1.7.1.js" />
- <Content Include="Scripts\jquery-1.7.1.min.js" />
- <None Include="Scripts\jquery.validate-vsdoc.js" />
- <Content Include="Scripts\jquery-ui-1.8.20.js" />
- <Content Include="Scripts\jquery-ui-1.8.20.min.js" />
- <Content Include="Scripts\jquery.unobtrusive-ajax.js" />
- <Content Include="Scripts\jquery.unobtrusive-ajax.min.js" />
- <Content Include="Scripts\jquery.validate.js" />
- <Content Include="Scripts\jquery.validate.min.js" />
- <Content Include="Scripts\jquery.validate.unobtrusive.js" />
- <Content Include="Scripts\jquery.validate.unobtrusive.min.js" />
- <Content Include="Scripts\knockout-2.1.0.debug.js" />
- <Content Include="Scripts\knockout-2.1.0.js" />
- <Content Include="Scripts\modernizr-2.5.3.js" />
- <Content Include="Web.config" />
- <Content Include="Web.Debug.config">
- <DependentUpon>Web.config</DependentUpon>
- </Content>
- <Content Include="Web.Release.config">
- <DependentUpon>Web.config</DependentUpon>
- </Content>
- <Content Include="Content\Site.css" />
- <Content Include="Scripts\_references.js" />
- <Content Include="Images\accent.png" />
- <Content Include="Images\bullet.png" />
- <Content Include="Images\heroAccent.png" />
- <Content Include="Images\orderedList0.png" />
- <Content Include="Images\orderedList1.png" />
- <Content Include="Images\orderedList2.png" />
- <Content Include="Images\orderedList3.png" />
- <Content Include="Images\orderedList4.png" />
- <Content Include="Images\orderedList5.png" />
- <Content Include="Images\orderedList6.png" />
- <Content Include="Images\orderedList7.png" />
- <Content Include="Images\orderedList8.png" />
- <Content Include="Images\orderedList9.png" />
- <Content Include="Views\_ViewStart.cshtml" />
- <Content Include="Views\Account\_ChangePasswordPartial.cshtml" />
- <Content Include="Views\Account\_ExternalLoginsListPartial.cshtml" />
- <Content Include="Views\Account\_RemoveExternalLoginsPartial.cshtml" />
- <Content Include="Views\Account\_SetPasswordPartial.cshtml" />
- <Content Include="Views\Account\Login.cshtml" />
- <Content Include="Views\Account\Manage.cshtml" />
- <Content Include="Views\Account\Register.cshtml" />
- <Content Include="Views\Account\ExternalLoginFailure.cshtml" />
- <Content Include="Views\Account\ExternalLoginConfirmation.cshtml" />
- <Content Include="Views\Home\About.cshtml" />
- <Content Include="Views\Home\Contact.cshtml" />
- <Content Include="Views\Home\Index.cshtml" />
- <Content Include="Views\Shared\Error.cshtml" />
- <Content Include="Views\Shared\_LoginPartial.cshtml" />
- <Content Include="Views\Shared\_Layout.cshtml" />
- <Content Include="Views\Web.config" />
- </ItemGroup>
- <ItemGroup>
- <Folder Include="App_Data\" />
- </ItemGroup>
- <ItemGroup>
- <Content Include="packages.config" />
- </ItemGroup>
- <PropertyGroup>
- <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
- <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
- </PropertyGroup>
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
- <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
- <Target Name="MvcBuildViews" AfterTargets="AfterBuild" Condition="'$(MvcBuildViews)'=='true'">
- <AspNetCompiler VirtualPath="temp" PhysicalPath="$(WebProjectOutputDir)" />
- </Target>
- <ProjectExtensions>
- <VisualStudio>
- <FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
- <WebProjectProperties>
- <UseIIS>True</UseIIS>
- <AutoAssignPort>True</AutoAssignPort>
- <DevelopmentServerPort>0</DevelopmentServerPort>
- <DevelopmentServerVPath>/</DevelopmentServerVPath>
- <IISUrl>http://localhost:6738/</IISUrl>
- <NTLMAuthentication>False</NTLMAuthentication>
- <UseCustomServer>False</UseCustomServer>
- <CustomServerUrl>
- </CustomServerUrl>
- <SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
- </WebProjectProperties>
- </FlavorProperties>
- </VisualStudio>
- </ProjectExtensions>
- <Import Project="$(SolutionDir)\.nuget\nuget.targets" />
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
- Other similar extension points exist, see Microsoft.Common.targets.
- <Target Name="BeforeBuild">
- </Target>
- <Target Name="AfterBuild">
- </Target> -->
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>
+ </ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{38A68603-BC0F-4955-A4BD-B9E14BC72A0F}</ProjectGuid>
+ <ProjectTypeGuids>{E3E379DF-F4C6-4180-9B81-6769533ABE47};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>PersonaMVC4Example</RootNamespace>
+ <AssemblyName>PersonaMVC4Example</AssemblyName>
+ <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+ <MvcBuildViews>false</MvcBuildViews>
+ <UseIISExpress>true</UseIISExpress>
+ <IISExpressSSLPort />
+ <IISExpressAnonymousAuthentication>enabled</IISExpressAnonymousAuthentication>
+ <IISExpressWindowsAuthentication>enabled</IISExpressWindowsAuthentication>
+ <IISExpressUseClassicPipelineMode>false</IISExpressUseClassicPipelineMode>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
+ <RestorePackages>true</RestorePackages>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Microsoft.CSharp" />
+ <Reference Include="System" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Data.Entity" />
+ <Reference Include="System.Drawing" />
+ <Reference Include="System.Web.DynamicData" />
+ <Reference Include="System.Web.Entity" />
+ <Reference Include="System.Web.ApplicationServices" />
+ <Reference Include="System.ComponentModel.DataAnnotations" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Data.DataSetExtensions" />
+ <Reference Include="System.Xml.Linq" />
+ <Reference Include="System.Web" />
+ <Reference Include="System.Web.Extensions" />
+ <Reference Include="System.Web.Abstractions" />
+ <Reference Include="System.Web.Routing" />
+ <Reference Include="System.Xml" />
+ <Reference Include="System.Configuration" />
+ <Reference Include="System.Transactions" />
+ <Reference Include="System.Web.Services" />
+ <Reference Include="System.EnterpriseServices" />
+ <Reference Include="EntityFramework">
+ <HintPath>..\packages\EntityFramework.5.0.0\lib\net45\EntityFramework.dll</HintPath>
+ </Reference>
+ <Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <Private>True</Private>
+ <HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
+ </Reference>
+ <Reference Include="Newtonsoft.Json">
+ <HintPath>..\packages\Newtonsoft.Json.4.5.6\lib\net40\Newtonsoft.Json.dll</HintPath>
+ </Reference>
+ <Reference Include="System.Net.Http">
+ </Reference>
+ <Reference Include="System.Net.Http.Formatting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <HintPath>..\packages\Microsoft.AspNet.WebApi.Client.4.0.20710.0\lib\net40\System.Net.Http.Formatting.dll</HintPath>
+ </Reference>
+ <Reference Include="System.Net.Http.WebRequest">
+ </Reference>
+ <Reference Include="System.Web.Helpers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <Private>True</Private>
+ <HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.Helpers.dll</HintPath>
+ </Reference>
+ <Reference Include="System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <HintPath>..\packages\Microsoft.AspNet.WebApi.Core.4.0.20710.0\lib\net40\System.Web.Http.dll</HintPath>
+ </Reference>
+ <Reference Include="System.Web.Http.WebHost, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <HintPath>..\packages\Microsoft.AspNet.WebApi.WebHost.4.0.20710.0\lib\net40\System.Web.Http.WebHost.dll</HintPath>
+ </Reference>
+ <Reference Include="System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <Private>True</Private>
+ <HintPath>..\packages\Microsoft.AspNet.Mvc.4.0.20710.0\lib\net40\System.Web.Mvc.dll</HintPath>
+ </Reference>
+ <Reference Include="System.Web.Optimization">
+ <HintPath>..\packages\Microsoft.AspNet.Web.Optimization.1.0.0\lib\net40\System.Web.Optimization.dll</HintPath>
+ </Reference>
+ <Reference Include="System.Web.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <Private>True</Private>
+ <HintPath>..\packages\Microsoft.AspNet.Razor.2.0.20710.0\lib\net40\System.Web.Razor.dll</HintPath>
+ </Reference>
+ <Reference Include="System.Web.WebPages, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <Private>True</Private>
+ <HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.WebPages.dll</HintPath>
+ </Reference>
+ <Reference Include="System.Web.WebPages.Deployment, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <Private>True</Private>
+ <HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.WebPages.Deployment.dll</HintPath>
+ </Reference>
+ <Reference Include="System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <Private>True</Private>
+ <HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.WebPages.Razor.dll</HintPath>
+ </Reference>
+ <Reference Include="WebMatrix.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <Private>True</Private>
+ <HintPath>..\packages\Microsoft.AspNet.WebPages.Data.2.0.20710.0\lib\net40\WebMatrix.Data.dll</HintPath>
+ </Reference>
+ <Reference Include="Microsoft.Web.WebPages.OAuth, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <Private>True</Private>
+ <HintPath>..\packages\Microsoft.AspNet.WebPages.OAuth.2.0.20710.0\lib\net40\Microsoft.Web.WebPages.OAuth.dll</HintPath>
+ </Reference>
+ <Reference Include="WebMatrix.WebData, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <Private>True</Private>
+ <HintPath>..\packages\Microsoft.AspNet.WebPages.WebData.2.0.20710.0\lib\net40\WebMatrix.WebData.dll</HintPath>
+ </Reference>
+ <Reference Include="DotNetOpenAuth.AspNet, Version=4.0.0.0, Culture=neutral, PublicKeyToken=2780ccd10d57b246, processorArchitecture=MSIL">
+ <Private>True</Private>
+ <HintPath>..\packages\DotNetOpenAuth.AspNet.4.0.3.12153\lib\net40-full\DotNetOpenAuth.AspNet.dll</HintPath>
+ </Reference>
+ <Reference Include="DotNetOpenAuth.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=2780ccd10d57b246, processorArchitecture=MSIL">
+ <Private>True</Private>
+ <HintPath>..\packages\DotNetOpenAuth.Core.4.0.3.12153\lib\net40-full\DotNetOpenAuth.Core.dll</HintPath>
+ </Reference>
+ <Reference Include="DotNetOpenAuth.OAuth.Consumer, Version=4.0.0.0, Culture=neutral, PublicKeyToken=2780ccd10d57b246, processorArchitecture=MSIL">
+ <Private>True</Private>
+ <HintPath>..\packages\DotNetOpenAuth.OAuth.Consumer.4.0.3.12153\lib\net40-full\DotNetOpenAuth.OAuth.Consumer.dll</HintPath>
+ </Reference>
+ <Reference Include="DotNetOpenAuth.OAuth, Version=4.0.0.0, Culture=neutral, PublicKeyToken=2780ccd10d57b246, processorArchitecture=MSIL">
+ <Private>True</Private>
+ <HintPath>..\packages\DotNetOpenAuth.OAuth.Core.4.0.3.12153\lib\net40-full\DotNetOpenAuth.OAuth.dll</HintPath>
+ </Reference>
+ <Reference Include="DotNetOpenAuth.OpenId, Version=4.0.0.0, Culture=neutral, PublicKeyToken=2780ccd10d57b246, processorArchitecture=MSIL">
+ <Private>True</Private>
+ <HintPath>..\packages\DotNetOpenAuth.OpenId.Core.4.0.3.12153\lib\net40-full\DotNetOpenAuth.OpenId.dll</HintPath>
+ </Reference>
+ <Reference Include="DotNetOpenAuth.OpenId.RelyingParty, Version=4.0.0.0, Culture=neutral, PublicKeyToken=2780ccd10d57b246, processorArchitecture=MSIL">
+ <Private>True</Private>
+ <HintPath>..\packages\DotNetOpenAuth.OpenId.RelyingParty.4.0.3.12153\lib\net40-full\DotNetOpenAuth.OpenId.RelyingParty.dll</HintPath>
+ </Reference>
+ <Reference Include="WebGrease">
+ <Private>True</Private>
+ <HintPath>..\packages\WebGrease.1.1.0\lib\WebGrease.dll</HintPath>
+ </Reference>
+ <Reference Include="Antlr3.Runtime">
+ <Private>True</Private>
+ <HintPath>..\packages\WebGrease.1.1.0\lib\Antlr3.Runtime.dll</HintPath>
+ </Reference>
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="App_Start\AuthConfig.cs" />
+ <Compile Include="App_Start\BundleConfig.cs" />
+ <Compile Include="App_Start\FilterConfig.cs" />
+ <Compile Include="App_Start\RouteConfig.cs" />
+ <Compile Include="App_Start\WebApiConfig.cs" />
+ <Compile Include="Controllers\AccountController.cs" />
+ <Compile Include="Controllers\HomeController.cs" />
+ <Compile Include="Controllers\PersonaController.cs" />
+ <Compile Include="Filters\HttpHeaderAntiforgeryTokenAttribute.cs" />
+ <Compile Include="Filters\InitializeSimpleMembershipAttribute.cs" />
+ <Compile Include="Global.asax.cs">
+ <DependentUpon>Global.asax</DependentUpon>
+ </Compile>
+ <Compile Include="Helpers\PersonaAuthenticationClient.cs" />
+ <Compile Include="ModelBinders\SimplePostVariableParameterBinding.cs" />
+ <Compile Include="ModelBinders\SimplePostVariableParameterBindingAttribute.cs" />
+ <Compile Include="Models\AccountModels.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="Content\persona-buttons.css" />
+ <Content Include="Content\themes\base\images\ui-bg_flat_0_aaaaaa_40x100.png" />
+ <Content Include="Content\themes\base\images\ui-bg_flat_75_ffffff_40x100.png" />
+ <Content Include="Content\themes\base\images\ui-bg_glass_55_fbf9ee_1x400.png" />
+ <Content Include="Content\themes\base\images\ui-bg_glass_65_ffffff_1x400.png" />
+ <Content Include="Content\themes\base\images\ui-bg_glass_75_dadada_1x400.png" />
+ <Content Include="Content\themes\base\images\ui-bg_glass_75_e6e6e6_1x400.png" />
+ <Content Include="Content\themes\base\images\ui-bg_glass_95_fef1ec_1x400.png" />
+ <Content Include="Content\themes\base\images\ui-bg_highlight-soft_75_cccccc_1x100.png" />
+ <Content Include="Content\themes\base\images\ui-icons_222222_256x240.png" />
+ <Content Include="Content\themes\base\images\ui-icons_2e83ff_256x240.png" />
+ <Content Include="Content\themes\base\images\ui-icons_454545_256x240.png" />
+ <Content Include="Content\themes\base\images\ui-icons_888888_256x240.png" />
+ <Content Include="Content\themes\base\images\ui-icons_cd0a0a_256x240.png" />
+ <Content Include="Content\themes\base\jquery-ui.css" />
+ <Content Include="Content\themes\base\jquery.ui.accordion.css" />
+ <Content Include="Content\themes\base\jquery.ui.all.css" />
+ <Content Include="Content\themes\base\jquery.ui.autocomplete.css" />
+ <Content Include="Content\themes\base\jquery.ui.base.css" />
+ <Content Include="Content\themes\base\jquery.ui.button.css" />
+ <Content Include="Content\themes\base\jquery.ui.core.css" />
+ <Content Include="Content\themes\base\jquery.ui.datepicker.css" />
+ <Content Include="Content\themes\base\jquery.ui.dialog.css" />
+ <Content Include="Content\themes\base\jquery.ui.progressbar.css" />
+ <Content Include="Content\themes\base\jquery.ui.resizable.css" />
+ <Content Include="Content\themes\base\jquery.ui.selectable.css" />
+ <Content Include="Content\themes\base\jquery.ui.slider.css" />
+ <Content Include="Content\themes\base\jquery.ui.tabs.css" />
+ <Content Include="Content\themes\base\jquery.ui.theme.css" />
+ <Content Include="Content\themes\base\minified\images\ui-bg_flat_0_aaaaaa_40x100.png" />
+ <Content Include="Content\themes\base\minified\images\ui-bg_flat_75_ffffff_40x100.png" />
+ <Content Include="Content\themes\base\minified\images\ui-bg_glass_55_fbf9ee_1x400.png" />
+ <Content Include="Content\themes\base\minified\images\ui-bg_glass_65_ffffff_1x400.png" />
+ <Content Include="Content\themes\base\minified\images\ui-bg_glass_75_dadada_1x400.png" />
+ <Content Include="Content\themes\base\minified\images\ui-bg_glass_75_e6e6e6_1x400.png" />
+ <Content Include="Content\themes\base\minified\images\ui-bg_glass_95_fef1ec_1x400.png" />
+ <Content Include="Content\themes\base\minified\images\ui-bg_highlight-soft_75_cccccc_1x100.png" />
+ <Content Include="Content\themes\base\minified\images\ui-icons_222222_256x240.png" />
+ <Content Include="Content\themes\base\minified\images\ui-icons_2e83ff_256x240.png" />
+ <Content Include="Content\themes\base\minified\images\ui-icons_454545_256x240.png" />
+ <Content Include="Content\themes\base\minified\images\ui-icons_888888_256x240.png" />
+ <Content Include="Content\themes\base\minified\images\ui-icons_cd0a0a_256x240.png" />
+ <Content Include="Content\themes\base\minified\jquery-ui.min.css" />
+ <Content Include="Content\themes\base\minified\jquery.ui.accordion.min.css" />
+ <Content Include="Content\themes\base\minified\jquery.ui.autocomplete.min.css" />
+ <Content Include="Content\themes\base\minified\jquery.ui.button.min.css" />
+ <Content Include="Content\themes\base\minified\jquery.ui.core.min.css" />
+ <Content Include="Content\themes\base\minified\jquery.ui.datepicker.min.css" />
+ <Content Include="Content\themes\base\minified\jquery.ui.dialog.min.css" />
+ <Content Include="Content\themes\base\minified\jquery.ui.progressbar.min.css" />
+ <Content Include="Content\themes\base\minified\jquery.ui.resizable.min.css" />
+ <Content Include="Content\themes\base\minified\jquery.ui.selectable.min.css" />
+ <Content Include="Content\themes\base\minified\jquery.ui.slider.min.css" />
+ <Content Include="Content\themes\base\minified\jquery.ui.tabs.min.css" />
+ <Content Include="Content\themes\base\minified\jquery.ui.theme.min.css" />
+ <Content Include="favicon.ico" />
+ <Content Include="Global.asax" />
+ <None Include="Scripts\jquery-1.7.1.intellisense.js" />
+ <Content Include="Images\personasinginbutton.png" />
+ <Content Include="Scripts\jquery-1.7.1.js" />
+ <Content Include="Scripts\jquery-1.7.1.min.js" />
+ <None Include="Scripts\jquery.validate-vsdoc.js" />
+ <Content Include="Scripts\jquery-ui-1.8.20.js" />
+ <Content Include="Scripts\jquery-ui-1.8.20.min.js" />
+ <Content Include="Scripts\jquery.unobtrusive-ajax.js" />
+ <Content Include="Scripts\jquery.unobtrusive-ajax.min.js" />
+ <Content Include="Scripts\jquery.validate.js" />
+ <Content Include="Scripts\jquery.validate.min.js" />
+ <Content Include="Scripts\jquery.validate.unobtrusive.js" />
+ <Content Include="Scripts\jquery.validate.unobtrusive.min.js" />
+ <Content Include="Scripts\knockout-2.1.0.debug.js" />
+ <Content Include="Scripts\knockout-2.1.0.js" />
+ <Content Include="Scripts\modernizr-2.5.3.js" />
+ <Content Include="Web.config" />
+ <Content Include="Web.Debug.config">
+ <DependentUpon>Web.config</DependentUpon>
+ </Content>
+ <Content Include="Web.Release.config">
+ <DependentUpon>Web.config</DependentUpon>
+ </Content>
+ <Content Include="Content\Site.css" />
+ <Content Include="Scripts\_references.js" />
+ <Content Include="Images\accent.png" />
+ <Content Include="Images\bullet.png" />
+ <Content Include="Images\heroAccent.png" />
+ <Content Include="Images\orderedList0.png" />
+ <Content Include="Images\orderedList1.png" />
+ <Content Include="Images\orderedList2.png" />
+ <Content Include="Images\orderedList3.png" />
+ <Content Include="Images\orderedList4.png" />
+ <Content Include="Images\orderedList5.png" />
+ <Content Include="Images\orderedList6.png" />
+ <Content Include="Images\orderedList7.png" />
+ <Content Include="Images\orderedList8.png" />
+ <Content Include="Images\orderedList9.png" />
+ <Content Include="Views\_ViewStart.cshtml" />
+ <Content Include="Views\Account\_ChangePasswordPartial.cshtml" />
+ <Content Include="Views\Account\_ExternalLoginsListPartial.cshtml" />
+ <Content Include="Views\Account\_RemoveExternalLoginsPartial.cshtml" />
+ <Content Include="Views\Account\_SetPasswordPartial.cshtml" />
+ <Content Include="Views\Account\Login.cshtml" />
+ <Content Include="Views\Account\Manage.cshtml" />
+ <Content Include="Views\Account\Register.cshtml" />
+ <Content Include="Views\Account\ExternalLoginFailure.cshtml" />
+ <Content Include="Views\Account\ExternalLoginConfirmation.cshtml" />
+ <Content Include="Views\Home\About.cshtml" />
+ <Content Include="Views\Home\Contact.cshtml" />
+ <Content Include="Views\Home\Index.cshtml" />
+ <Content Include="Views\Shared\Error.cshtml" />
+ <Content Include="Views\Shared\_LoginPartial.cshtml" />
+ <Content Include="Views\Shared\_Layout.cshtml" />
+ <Content Include="Views\Web.config" />
+ </ItemGroup>
+ <ItemGroup>
+ <Folder Include="App_Data\" />
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="packages.config" />
+ </ItemGroup>
+ <PropertyGroup>
+ <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
+ <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
+ </PropertyGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+ <Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
+ <Target Name="MvcBuildViews" AfterTargets="AfterBuild" Condition="'$(MvcBuildViews)'=='true'">
+ <AspNetCompiler VirtualPath="temp" PhysicalPath="$(WebProjectOutputDir)" />
+ </Target>
+ <ProjectExtensions>
+ <VisualStudio>
+ <FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
+ <WebProjectProperties>
+ <UseIIS>True</UseIIS>
+ <AutoAssignPort>True</AutoAssignPort>
+ <DevelopmentServerPort>0</DevelopmentServerPort>
+ <DevelopmentServerVPath>/</DevelopmentServerVPath>
+ <IISUrl>http://localhost:6738/</IISUrl>
+ <NTLMAuthentication>False</NTLMAuthentication>
+ <UseCustomServer>False</UseCustomServer>
+ <CustomServerUrl>
+ </CustomServerUrl>
+ <SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
+ </WebProjectProperties>
+ </FlavorProperties>
+ </VisualStudio>
+ </ProjectExtensions>
+ <Import Project="$(SolutionDir)\.nuget\nuget.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target> -->
</Project>
View
163 MVC4/PersonaMVC4Example/Views/Account/Login.cshtml
@@ -1,80 +1,83 @@
-@model PersonaMVC4Example.Models.LoginModel
-
-@{
- ViewBag.Title = "Log in";
-}
-
-<hgroup class="title">
- <h1>@ViewBag.Title.</h1>
-</hgroup>
-
-<section id="loginForm">
-<h2>Use a local account to log in.</h2>
-@using (Html.BeginForm(new { ReturnUrl = ViewBag.ReturnUrl })) {
- @Html.AntiForgeryToken()
- @Html.ValidationSummary(true)
-
- <fieldset>
- <legend>Log in Form</legend>
- <ol>
- <li>
- @Html.LabelFor(m => m.UserName)
- @Html.TextBoxFor(m => m.UserName)
- @Html.ValidationMessageFor(m => m.UserName)
- </li>
- <li>
- @Html.LabelFor(m => m.Password)
- @Html.PasswordFor(m => m.Password)
- @Html.ValidationMessageFor(m => m.Password)
- </li>
- <li>
- @Html.CheckBoxFor(m => m.RememberMe)
- @Html.LabelFor(m => m.RememberMe, new { @class = "checkbox" })
- </li>
- </ol>
- <input type="submit" value="Log in" />
- </fieldset>
- <p>
- @Html.ActionLink("Register", "Register") if you don't have an account.
- </p>
-}
-</section>
-
-<section class="social" id="socialLoginForm">
- <h2>Use another service to log in.</h2>
- @Html.Action("ExternalLoginsList", new { ReturnUrl = ViewBag.ReturnUrl })
- </section>
-
-@section Scripts {
- @Scripts.Render("~/bundles/jqueryval")
-
- <!--
- Script from https://developer.mozilla.org/en-US/docs/Persona/Quick_Setup
- NEEDED FOR PERSONA - Should be moved into its own JavaScript
- -->
- <script>
- function onAssertion(assertion) {
- if (assertion) {
- $.ajax({ /* <-- This example uses jQuery, but you can use whatever you'd like */
- type: 'POST',
- url: '/api/persona/login', // This is a URL on your website.
- data: { assertion: assertion, },
- success: function (res, status, xhr) { window.location.reload(); },
- error: function (res, status, xhr) { alert("login failure" + res); }
- });
- }
- else {
- alert('Error while performing Browser ID authentication!');
- }
- }
-
- $(document).ready(function () {
- $("#personasignin").click(function () {
- navigator.id.get(onAssertion);
- return false;
- });
- });
-
-
- </script>
-}
+@model PersonaMVC4Example.Models.LoginModel
+
+@{
+ ViewBag.Title = "Log in";
+}
+
+<hgroup class="title">
+ <h1>@ViewBag.Title.</h1>
+</hgroup>
+
+<section id="loginForm">
+<h2>Use a local account to log in.</h2>
+@using (Html.BeginForm(new { ReturnUrl = ViewBag.ReturnUrl })) {
+ @Html.AntiForgeryToken()
+ @Html.ValidationSummary(true)
+
+ <fieldset>
+ <legend>Log in Form</legend>
+ <ol>
+ <li>
+ @Html.LabelFor(m => m.UserName)
+ @Html.TextBoxFor(m => m.UserName)
+ @Html.ValidationMessageFor(m => m.UserName)
+ </li>
+ <li>
+ @Html.LabelFor(m => m.Password)
+ @Html.PasswordFor(m => m.Password)
+ @Html.ValidationMessageFor(m => m.Password)
+ </li>
+ <li>
+ @Html.CheckBoxFor(m => m.RememberMe)
+ @Html.LabelFor(m => m.RememberMe, new { @class = "checkbox" })
+ </li>
+ </ol>
+ <input type="submit" value="Log in" />
+ </fieldset>
+ <p>
+ @Html.ActionLink("Register", "Register") if you don't have an account.
+ </p>
+}
+</section>
+
+<section class="social" id="socialLoginForm">
+ <h2>Use another service to log in.</h2>
+ @Html.Action("ExternalLoginsList", new { ReturnUrl = ViewBag.ReturnUrl })
+ </section>
+
+@section Scripts {
+ @Scripts.Render("~/bundles/jqueryval")
+
+ <!--
+ Script from https://developer.mozilla.org/en-US/docs/Persona/Quick_Setup
+ NEEDED FOR PERSONA - Should be moved into its own JavaScript
+ -->
+ <script>
+ function onAssertion(assertion) {
+ if (assertion) {
+ $.ajax({ /* <-- This example uses jQuery, but you can use whatever you'd like */
+ headers: { // Pass the Token in a header value.
+ '__RequestVerificationToken': $("input[name='__RequestVerificationToken']").val()
+ },
+ type: 'POST',
+ url: '/api/persona/login', // This is a URL on your website.
+ data: { '': assertion, }, //Use this format to make it work with the [FromBody] WebApi Attribute http://www.asp.net/web-api/overview/working-with-http/sending-html-form-data,-part-1
+ success: function (res, status, xhr) { window.location.reload(); },
+ error: function (res, status, xhr) { alert("login failure" + res); }
+ });
+ }
+ else {
+ alert('Error while performing Browser ID authentication!');
+ }
+ }
+
+ $(document).ready(function () {
+ $("#personasignin").click(function () {
+ navigator.id.get(onAssertion);
+ return false;
+ });
+ });
+
+
+ </script>
+}

0 comments on commit 29482fe

Please sign in to comment.
Something went wrong with that request. Please try again.