{"id":334,"date":"2014-08-05T17:44:09","date_gmt":"2014-08-05T17:44:09","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/webdev\/2014\/08\/05\/announcing-rtm-of-asp-net-identity-2-1-0\/"},"modified":"2022-08-08T04:27:11","modified_gmt":"2022-08-08T11:27:11","slug":"announcing-rtm-of-asp-net-identity-2-1-0","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/dotnet\/announcing-rtm-of-asp-net-identity-2-1-0\/","title":{"rendered":"Announcing RTM of ASP.NET Identity 2.1.0"},"content":{"rendered":"<p><font size=\"2\">We are releasing RTM of ASP.NET Identity 2.1.0. The main focus in this release was to fix bugs and add <em>SignInManager<\/em> to make it easier to use security features such as Account Lockout, Two-Factor Authentication for login.<\/font><\/p>\n<p><font size=\"2\">ASP.NET Identity 2.1 is included in the ASP.NET templates which were released with <\/font><a href=\"http:\/\/blogs.msdn.com\/b\/webdev\/archive\/2014\/08\/04\/announcing-new-web-features-in-visual-studio-2013-update-3-rtm.aspx\"><font size=\"2\">VS 2013 Update 3<\/font><\/a><font size=\"2\">. The templates have been updated to include Two-Factor Authentication.<\/font><\/p>\n<h3>Download this release<\/h3>\n<p><font size=\"2\">You can download ASP.NET Identity from the NuGet gallery. You can install or update these packages using the NuGet Package Manager Console, like this:<\/font><\/p>\n<p><font size=\"2\"><em>Install-Package <\/em><\/font><a href=\"https:\/\/www.nuget.org\/packages\/Microsoft.AspNet.Identity.EntityFramework\"><font size=\"2\"><em>Microsoft.AspNet.Identity.EntityFramework<\/em><\/font><\/a><font size=\"2\"><em> \u2013Version 2.1.0&#160; <\/em><\/font><\/p>\n<p><font size=\"2\"><em>Install-Package <\/em><\/font><a href=\"https:\/\/www.nuget.org\/packages\/Microsoft.AspNet.Identity.Core\"><font size=\"2\"><em>Microsoft.AspNet.Identity.Core<\/em><\/font><\/a><font size=\"2\"><em> -Version 2.1.0 <\/em><\/font><\/p>\n<p><font size=\"2\"><em>Install-Package <\/em><\/font><a href=\"https:\/\/www.nuget.org\/packages\/Microsoft.AspNet.Identity.OWIN\"><font size=\"2\"><em>Microsoft.AspNet.Identity.OWIN<\/em><\/font><\/a><font size=\"2\"><em> -Version 2.1.0<\/em><\/font> <\/p>\n<h3>What\u2019s in this release?<\/h3>\n<p>Following is the list of features and major issues that were fixed in 2.1.0.<\/p>\n<h3>SignInManager<\/h3>\n<p><em>SignInManager<\/em> makes it easier to add Two-Factor authentication, account lockout and other features when you login. <\/p>\n<p><em>SignInManager<\/em> was in the samples package in ASP.NET Identity 2.0. In version 2.1, we have added it in the framework<\/p>\n<p>The following tutorials cover account confirmation and Two-Factor Authentication (including account lockout and protecting against brute force attacks against the two factor authentication codes)<\/p>\n<p><a title=\"http:\/\/www.asp.net\/identity\/overview\/features-api\/account-confirmation-and-password-recovery-with-aspnet-identity\" href=\"http:\/\/www.asp.net\/identity\/overview\/features-api\/account-confirmation-and-password-recovery-with-aspnet-identity\">http:\/\/www.asp.net\/identity\/overview\/features-api\/account-confirmation-and-password-recovery-with-aspnet-identity<\/a><\/p>\n<p><a title=\"http:\/\/www.asp.net\/identity\/overview\/features-api\/two-factor-authentication-using-sms-and-email-with-aspnet-identity\" href=\"http:\/\/www.asp.net\/identity\/overview\/features-api\/two-factor-authentication-using-sms-and-email-with-aspnet-identity\">http:\/\/www.asp.net\/identity\/overview\/features-api\/two-factor-authentication-using-sms-and-email-with-aspnet-identity<\/a><\/p>\n<p>Following show the login code of an application which uses two-factor authentication and account lockout.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/aspnet\/wp-content\/uploads\/sites\/16\/2014\/08\/0753.logincode_thumb_248C3C7E.png\"><img decoding=\"async\" title=\"logincode\" style=\"border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px\" border=\"0\" alt=\"logincode\" src=\"https:\/\/devblogs.microsoft.com\/aspnet\/wp-content\/uploads\/sites\/16\/2014\/08\/0753.logincode_thumb_248C3C7E.png\" width=\"726\" height=\"372\" \/><\/a> <\/p>\n<h3>List of bugs fixed<\/h3>\n<p>You can look at all the bugs that were fixed in this release by clicking <a href=\"https:\/\/aspnetidentity.codeplex.com\/workitem\/list\/advanced?keyword=&amp;status=Resolved%7cClosed&amp;type=All&amp;priority=All&amp;release=2.1&amp;assignedTo=All&amp;component=All&amp;reasonClosed=All%7cFixed&amp;sortField=LastUpdatedDate&amp;sortDirection=Descending&amp;page=0\">here<\/a>.<\/p>\n<h3>Enable Two-Factor Authentication in ASP.NET templates using VS 2013 Update 3<\/h3>\n<p>The following steps summarize the experience of enabling Two-Factor Authentication using SMS in ASP.NET MVC. You can follow the same steps for other templates such as Web Forms as well. You can also write your own Two-Factor authentication provider (such as using QR codes using authenticator apps) and plug it in.<\/p>\n<p>For a more detailed walkthrough of the code and the concepts refer to the following article <a title=\"http:\/\/www.asp.net\/identity\/overview\/features-api\/two-factor-authentication-using-sms-and-email-with-aspnet-identity\" href=\"http:\/\/www.asp.net\/identity\/overview\/features-api\/two-factor-authentication-using-sms-and-email-with-aspnet-identity\">http:\/\/www.asp.net\/identity\/overview\/features-api\/two-factor-authentication-using-sms-and-email-with-aspnet-identity<\/a><\/p>\n<ul>\n<li><strong>Create ASP.NET MVC Template <\/strong>and select Authentication using Individual User Accounts <\/li>\n<li>Open <strong>ViewsManageIndex.cshtml<\/strong> and \u201c<strong>Add Phone Number option<\/strong>\u201d by uncommenting the following lines       \n<div id=\"scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:8ead3a43-8c23-4140-9072-a784352f3e19\" class=\"wlWriterSmartContent\" style=\"float: none;padding-bottom: 0px;padding-top: 0px;padding-left: 0px;margin: 0px;padding-right: 0px\">\n<div>\n<div style=\"font-family: verdana, tahoma, arial, sans-serif;background: #000080;font-weight: bold;color: #fff;padding-bottom: 2px;padding-top: 2px;padding-left: 5px;padding-right: 5px\">Code Snippet<\/div>\n<div style=\"overflow: auto;background: #ddd;max-height: 300px\">\n<ol style=\"background: #ffffff;padding-bottom: 0px;padding-top: 0px;padding-left: 5px;margin: 0px 0px 0px 2.5em;padding-right: 0px\">\n<li><span style=\"background: #ffffff;color: #0000ff\">&lt;<\/span><span style=\"background: #ffffff;color: #800000\">dt<\/span><span style=\"background: #ffffff;color: #0000ff\">&gt;<\/span><span style=\"background: #ffffff;color: #000000\">Phone Number:<\/span><span style=\"background: #ffffff;color: #0000ff\">&lt;\/<\/span><span style=\"background: #ffffff;color: #800000\">dt<\/span><span style=\"background: #ffffff;color: #0000ff\">&gt;<\/span> <\/li>\n<li style=\"background: #f3f3f3\">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style=\"background: #ffffff;color: #000000\"><\/span><span style=\"background: #ffffff;color: #0000ff\">&lt;<\/span><span style=\"background: #ffffff;color: #800000\">dd<\/span><span style=\"background: #ffffff;color: #0000ff\">&gt;<\/span> <\/li>\n<li>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style=\"background: #ffffff;color: #000000\"><\/span><span style=\"background: #ffff00;color: #000000\">@(<\/span><span style=\"background: #ffffff;color: #000000\">Model.PhoneNumber ?? <\/span><span style=\"background: #ffffff;color: #a31515\">&quot;None&quot;<\/span><span style=\"background: #ffff00;color: #000000\">)<\/span><span style=\"background: #ffffff;color: #000000\"> [<\/span> <\/li>\n<li style=\"background: #f3f3f3\">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style=\"background: #ffffff;color: #000000\"><\/span><span style=\"background: #ffff00;color: #000000\">@<\/span><span style=\"background: #ffffff;color: #0000ff\">if<\/span><span style=\"background: #ffffff;color: #000000\"> (Model.PhoneNumber != <\/span><span style=\"background: #ffffff;color: #0000ff\">null<\/span><span style=\"background: #ffffff;color: #000000\">)<\/span> <\/li>\n<li>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style=\"background: #ffffff;color: #000000\">{<\/span> <\/li>\n<li style=\"background: #f3f3f3\">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style=\"background: #ffffff;color: #000000\"><\/span><span style=\"background: #ffff00;color: #000000\">@<\/span><span style=\"background: #ffffff;color: #000000\">Html.ActionLink(<\/span><span style=\"background: #ffffff;color: #a31515\">&quot;Change&quot;<\/span><span style=\"background: #ffffff;color: #000000\">, <\/span><span style=\"background: #ffffff;color: #a31515\">&quot;AddPhoneNumber&quot;<\/span><span style=\"background: #ffffff;color: #000000\">)<\/span> <\/li>\n<li>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style=\"background: #ffffff;color: #000000\"><\/span><span style=\"background: #ffff00;color: #000000\">@:<\/span><span style=\"background: #ffffff;color: #000000\"> <\/span><span style=\"background: #ffffff;color: #ff0000\">&amp;nbsp;<\/span><span style=\"background: #ffffff;color: #000000\">|<\/span><span style=\"background: #ffffff;color: #ff0000\">&amp;nbsp;<\/span> <\/li>\n<li style=\"background: #f3f3f3\">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style=\"background: #ffffff;color: #000000\"><\/span><span style=\"background: #ffff00;color: #000000\">@<\/span><span style=\"background: #ffffff;color: #000000\">Html.ActionLink(<\/span><span style=\"background: #ffffff;color: #a31515\">&quot;Remove&quot;<\/span><span style=\"background: #ffffff;color: #000000\">, <\/span><span style=\"background: #ffffff;color: #a31515\">&quot;RemovePhoneNumber&quot;<\/span><span style=\"background: #ffffff;color: #000000\">)<\/span> <\/li>\n<li>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style=\"background: #ffffff;color: #000000\">}<\/span> <\/li>\n<li style=\"background: #f3f3f3\">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style=\"background: #ffffff;color: #000000\"><\/span><span style=\"background: #ffffff;color: #0000ff\">else<\/span> <\/li>\n<li>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style=\"background: #ffffff;color: #000000\">{<\/span> <\/li>\n<li style=\"background: #f3f3f3\">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style=\"background: #ffffff;color: #000000\"><\/span><span style=\"background: #ffff00;color: #000000\">@<\/span><span style=\"background: #ffffff;color: #000000\">Html.ActionLink(<\/span><span style=\"background: #ffffff;color: #a31515\">&quot;Add&quot;<\/span><span style=\"background: #ffffff;color: #000000\">, <\/span><span style=\"background: #ffffff;color: #a31515\">&quot;AddPhoneNumber&quot;<\/span><span style=\"background: #ffffff;color: #000000\">)<\/span> <\/li>\n<li>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style=\"background: #ffffff;color: #000000\">}<\/span> <\/li>\n<li style=\"background: #f3f3f3\">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style=\"background: #ffffff;color: #000000\">]<\/span> <\/li>\n<li>&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style=\"background: #ffffff;color: #000000\"><\/span><span style=\"background: #ffffff;color: #0000ff\">&lt;\/<\/span><span style=\"background: #ffffff;color: #800000\">dd<\/span><span style=\"background: #ffffff;color: #0000ff\">&gt;<\/span> <\/li>\n<\/ol><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/li>\n<\/ul>\n<p>&#160;<\/p>\n<ul>\n<li>Open <strong>ViewsManageIndex.cshtml<\/strong> and <strong>enable<\/strong> \u201c<strong>Two-Factor Authentication<\/strong>\u201d <\/li>\n<li id=\"scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:a5c4bc40-ca3c-4063-b0ec-39697431d7c0\" class=\"wlWriterSmartContent\" style=\"float: none;padding-bottom: 0px;padding-top: 0px;padding-left: 0px;margin: 0px;padding-right: 0px\">\n<div>\n<div style=\"font-family: verdana, tahoma, arial, sans-serif;background: #000080;font-weight: bold;color: #fff;padding-bottom: 2px;padding-top: 2px;padding-left: 5px;padding-right: 5px\">Code Snippet<\/div>\n<div style=\"overflow: auto;background: #ddd;max-height: 300px\">\n<ol style=\"background: #ffffff;padding-bottom: 0px;padding-top: 0px;padding-left: 5px;margin: 0px 0px 0px 2.5em;padding-right: 0px\">\n<li><span style=\"background: #ffffff;color: #0000ff\">&lt;<\/span><span style=\"background: #ffffff;color: #800000\">dt<\/span><span style=\"background: #ffffff;color: #0000ff\">&gt;<\/span><span style=\"background: #ffffff;color: #000000\">Two-Factor Authentication:<\/span><span style=\"background: #ffffff;color: #0000ff\">&lt;\/<\/span><span style=\"background: #ffffff;color: #800000\">dt<\/span><span style=\"background: #ffffff;color: #0000ff\">&gt;<\/span> <\/li>\n<li style=\"background: #f3f3f3\">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style=\"background: #ffffff;color: #000000\"><\/span><span style=\"background: #ffffff;color: #0000ff\">&lt;<\/span><span style=\"background: #ffffff;color: #800000\">dd<\/span><span style=\"background: #ffffff;color: #0000ff\">&gt;<\/span> <\/li>\n<li>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style=\"background: #ffffff;color: #000000\"><\/span><span style=\"background: #ffff00;color: #000000\">@<\/span><span style=\"background: #ffffff;color: #0000ff\">if<\/span><span style=\"background: #ffffff;color: #000000\"> (Model.TwoFactor)<\/span> <\/li>\n<li style=\"background: #f3f3f3\">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style=\"background: #ffffff;color: #000000\">{<\/span> <\/li>\n<li>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style=\"background: #ffffff;color: #000000\"><\/span><span style=\"background: #ffffff;color: #0000ff\">using<\/span><span style=\"background: #ffffff;color: #000000\"> (Html.BeginForm(<\/span><span style=\"background: #ffffff;color: #a31515\">&quot;DisableTwoFactorAuthentication&quot;<\/span><span style=\"background: #ffffff;color: #000000\">, <\/span><span style=\"background: #ffffff;color: #a31515\">&quot;Manage&quot;<\/span><span style=\"background: #ffffff;color: #000000\">, <\/span><span style=\"background: #ffffff;color: #2b91af\">FormMethod<\/span><span style=\"background: #ffffff;color: #000000\">.Post, <\/span><span style=\"background: #ffffff;color: #0000ff\">new<\/span><span style=\"background: #ffffff;color: #000000\"> { @class = <\/span><span style=\"background: #ffffff;color: #a31515\">&quot;form-horizontal&quot;<\/span><span style=\"background: #ffffff;color: #000000\">, role = <\/span><span style=\"background: #ffffff;color: #a31515\">&quot;form&quot;<\/span><span style=\"background: #ffffff;color: #000000\"> }))<\/span> <\/li>\n<li style=\"background: #f3f3f3\">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style=\"background: #ffffff;color: #000000\">{<\/span> <\/li>\n<li>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style=\"background: #ffffff;color: #000000\"><\/span><span style=\"background: #ffff00;color: #000000\">@<\/span><span style=\"background: #ffffff;color: #000000\">Html.AntiForgeryToken()<\/span> <\/li>\n<li style=\"background: #f3f3f3\">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style=\"background: #ffffff;color: #000000\"><\/span><span style=\"background: #ffff00;color: #000000\">&lt;text&gt;<\/span><span style=\"background: #ffffff;color: #000000\">Enabled<\/span> <\/li>\n<li>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style=\"background: #ffffff;color: #000000\"><\/span><span style=\"background: #ffffff;color: #0000ff\">&lt;<\/span><span style=\"background: #ffffff;color: #800000\">input<\/span><span style=\"background: #ffffff;color: #000000\"> <\/span><span style=\"background: #ffffff;color: #ff0000\">type<\/span><span style=\"background: #ffffff;color: #0000ff\">=&quot;submit&quot;<\/span><span style=\"background: #ffffff;color: #000000\"> <\/span><span style=\"background: #ffffff;color: #ff0000\">value<\/span><span style=\"background: #ffffff;color: #0000ff\">=&quot;Disable&quot;<\/span><span style=\"background: #ffffff;color: #000000\"> <\/span><span style=\"background: #ffffff;color: #ff0000\">class<\/span><span style=\"background: #ffffff;color: #0000ff\">=&quot;btn btn-link&quot;<\/span><span style=\"background: #ffffff;color: #000000\"> <\/span><span style=\"background: #ffffff;color: #0000ff\">\/&gt;<\/span> <\/li>\n<li style=\"background: #f3f3f3\">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style=\"background: #ffffff;color: #000000\"><\/span><span style=\"background: #ffff00;color: #000000\">&lt;\/text&gt;<\/span> <\/li>\n<li>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style=\"background: #ffffff;color: #000000\">}<\/span> <\/li>\n<li style=\"background: #f3f3f3\">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style=\"background: #ffffff;color: #000000\">}<\/span> <\/li>\n<li>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style=\"background: #ffffff;color: #000000\"><\/span><span style=\"background: #ffffff;color: #0000ff\">else<\/span> <\/li>\n<li style=\"background: #f3f3f3\">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style=\"background: #ffffff;color: #000000\">{<\/span> <\/li>\n<li>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style=\"background: #ffffff;color: #000000\"><\/span><span style=\"background: #ffffff;color: #0000ff\">using<\/span><span style=\"background: #ffffff;color: #000000\"> (Html.BeginForm(<\/span><span style=\"background: #ffffff;color: #a31515\">&quot;EnableTwoFactorAuthentication&quot;<\/span><span style=\"background: #ffffff;color: #000000\">, <\/span><span style=\"background: #ffffff;color: #a31515\">&quot;Manage&quot;<\/span><span style=\"background: #ffffff;color: #000000\">, <\/span><span style=\"background: #ffffff;color: #2b91af\">FormMethod<\/span><span style=\"background: #ffffff;color: #000000\">.Post, <\/span><span style=\"background: #ffffff;color: #0000ff\">new<\/span><span style=\"background: #ffffff;color: #000000\"> { @class = <\/span><span style=\"background: #ffffff;color: #a31515\">&quot;form-horizontal&quot;<\/span><span style=\"background: #ffffff;color: #000000\">, role = <\/span><span style=\"background: #ffffff;color: #a31515\">&quot;form&quot;<\/span><span style=\"background: #ffffff;color: #000000\"> }))<\/span> <\/li>\n<li style=\"background: #f3f3f3\">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style=\"background: #ffffff;color: #000000\">{<\/span> <\/li>\n<li>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style=\"background: #ffffff;color: #000000\"><\/span><span style=\"background: #ffff00;color: #000000\">@<\/span><span style=\"background: #ffffff;color: #000000\">Html.AntiForgeryToken()<\/span> <\/li>\n<li style=\"background: #f3f3f3\">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style=\"background: #ffffff;color: #000000\"><\/span><span style=\"background: #ffff00;color: #000000\">&lt;text&gt;<\/span><span style=\"background: #ffffff;color: #000000\">Disabled<\/span> <\/li>\n<li>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style=\"background: #ffffff;color: #000000\"><\/span><span style=\"background: #ffffff;color: #0000ff\">&lt;<\/span><span style=\"background: #ffffff;color: #800000\">input<\/span><span style=\"background: #ffffff;color: #000000\"> <\/span><span style=\"background: #ffffff;color: #ff0000\">type<\/span><span style=\"background: #ffffff;color: #0000ff\">=&quot;submit&quot;<\/span><span style=\"background: #ffffff;color: #000000\"> <\/span><span style=\"background: #ffffff;color: #ff0000\">value<\/span><span style=\"background: #ffffff;color: #0000ff\">=&quot;Enable&quot;<\/span><span style=\"background: #ffffff;color: #000000\"> <\/span><span style=\"background: #ffffff;color: #ff0000\">class<\/span><span style=\"background: #ffffff;color: #0000ff\">=&quot;btn btn-link&quot;<\/span><span style=\"background: #ffffff;color: #000000\"> <\/span><span style=\"background: #ffffff;color: #0000ff\">\/&gt;<\/span> <\/li>\n<li style=\"background: #f3f3f3\">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style=\"background: #ffffff;color: #000000\"><\/span><span style=\"background: #ffff00;color: #000000\">&lt;\/text&gt;<\/span> <\/li>\n<li>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style=\"background: #ffffff;color: #000000\">}<\/span> <\/li>\n<li style=\"background: #f3f3f3\">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style=\"background: #ffffff;color: #000000\">}<\/span> <\/li>\n<li>&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style=\"background: #ffffff;color: #000000\"><\/span><span style=\"background: #ffffff;color: #0000ff\">&lt;\/<\/span><span style=\"background: #ffffff;color: #800000\">dd<\/span><span style=\"background: #ffffff;color: #0000ff\">&gt;<\/span> <\/li>\n<\/ol><\/div>\n<\/p><\/div>\n<\/li>\n<\/ul>\n<p><strong><\/strong><\/p>\n<ul>\n<li><strong>Register a SMS provider<\/strong> in App_StartIdentityConfig.cs       \n<ul>\n<li>You can use any SMS services such as Twilio or others. For more information on using Twilio see this <a href=\"http:\/\/www.asp.net\/identity\/overview\/features-api\/two-factor-authentication-using-sms-and-email-with-aspnet-identity#SMS\">post<\/a>. Your SMS service should look like as follows. <\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<blockquote>\n<div id=\"scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:9b2c2158-16f2-45f9-8e0d-5b9df3776ff9\" class=\"wlWriterSmartContent\" style=\"float: none;padding-bottom: 0px;padding-top: 0px;padding-left: 0px;margin: 0px;padding-right: 0px\">\n<div style=\"font-size: 10pt;border-top: #000080 1px solid;font-family: verdana, tahoma, arial, sans-serif;border-right: #000080 1px solid;background: #000080;border-bottom: #000080 1px solid;font-weight: bold;color: #fff;padding-bottom: 2px;padding-top: 2px;padding-left: 5px;border-left: #000080 1px solid;padding-right: 5px\">Code Snippet<\/div>\n<div>\n<div style=\"overflow: auto;background: #ddd;max-height: 300px\">\n<ol style=\"background: #ffffff;padding-bottom: 0px;padding-top: 0px;padding-left: 5px;margin: 0px 0px 0px 2.5em;padding-right: 0px\">\n<li><span style=\"background: #ffffff;color: #000000\"><\/span><span style=\"background: #ffffff;color: #0000ff\">public<\/span><span style=\"background: #ffffff;color: #000000\"> <\/span><span style=\"background: #ffffff;color: #0000ff\">class<\/span><span style=\"background: #ffffff;color: #000000\"> <\/span><span style=\"background: #ffffff;color: #2b91af\">SmsService<\/span><span style=\"background: #ffffff;color: #000000\"> : <\/span><span style=\"background: #ffffff;color: #2b91af\">IIdentityMessageService<\/span> <\/li>\n<li style=\"background: #f3f3f3\"><span style=\"background: #ffffff;color: #000000\">{<\/span> <\/li>\n<li>&#160;&#160;&#160; <span style=\"background: #ffffff;color: #000000\"><\/span><span style=\"background: #ffffff;color: #0000ff\">public<\/span><span style=\"background: #ffffff;color: #000000\"> <\/span><span style=\"background: #ffffff;color: #2b91af\">Task<\/span><span style=\"background: #ffffff;color: #000000\"> SendAsync(<\/span><span style=\"background: #ffffff;color: #2b91af\">IdentityMessage<\/span><span style=\"background: #ffffff;color: #000000\"> message)<\/span> <\/li>\n<li style=\"background: #f3f3f3\">&#160;&#160;&#160; <span style=\"background: #ffffff;color: #000000\">{<\/span> <\/li>\n<li>&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style=\"background: #ffffff;color: #000000\"><\/span><span style=\"background: #ffffff;color: #0000ff\">var<\/span><span style=\"background: #ffffff;color: #000000\"> Twilio = <\/span><span style=\"background: #ffffff;color: #0000ff\">new<\/span><span style=\"background: #ffffff;color: #000000\"> <\/span><span style=\"background: #ffffff;color: #2b91af\">TwilioRestClient<\/span><span style=\"background: #ffffff;color: #000000\">(<\/span><span style=\"background: #ffffff;color: #2b91af\">Keys<\/span><span style=\"background: #ffffff;color: #000000\">.TwilioSid, <\/span><span style=\"background: #ffffff;color: #2b91af\">Keys<\/span><span style=\"background: #ffffff;color: #000000\">.TwilioToken);<\/span> <\/li>\n<li style=\"background: #f3f3f3\">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style=\"background: #ffffff;color: #000000\"><\/span><span style=\"background: #ffffff;color: #0000ff\">var<\/span><span style=\"background: #ffffff;color: #000000\"> result = Twilio.SendMessage(<\/span><span style=\"background: #ffffff;color: #2b91af\">Keys<\/span><span style=\"background: #ffffff;color: #000000\">.FromPhone, message.Destination, message.Body);<\/span> <\/li>\n<li>&#160; <\/li>\n<li style=\"background: #f3f3f3\">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style=\"background: #ffffff;color: #000000\"><\/span><span style=\"background: #ffffff;color: #008000\">\/\/ Twilio doesn&#8217;t currently have an async API, so return success.<\/span> <\/li>\n<li>&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style=\"background: #ffffff;color: #000000\"><\/span><span style=\"background: #ffffff;color: #0000ff\">return<\/span><span style=\"background: #ffffff;color: #000000\"> <\/span><span style=\"background: #ffffff;color: #2b91af\">Task<\/span><span style=\"background: #ffffff;color: #000000\">.FromResult(0);<\/span> <\/li>\n<li style=\"background: #f3f3f3\">&#160;&#160;&#160; <span style=\"background: #ffffff;color: #000000\">}<\/span> <\/li>\n<li><span style=\"background: #ffffff;color: #000000\">}<\/span> <\/li>\n<\/ol><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p>\n<\/blockquote>\n<p><strong><\/strong><\/p>\n<ul>\n<li><strong>Register a user<\/strong>       \n<ul>\n<li>Browse to the site and register as a new user. <\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><strong><\/strong><\/p>\n<ul>\n<li><strong>Go to Manage page: <\/strong>Click your username after logging in and go to Manage page. Here is what the Manage page would look like once you login <\/li>\n<\/ul>\n<blockquote>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/aspnet\/wp-content\/uploads\/sites\/16\/2014\/08\/4747.Manage_thumb_294E6832.png\"><img decoding=\"async\" title=\"Manage\" style=\"border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px\" border=\"0\" alt=\"Manage\" src=\"https:\/\/devblogs.microsoft.com\/aspnet\/wp-content\/uploads\/sites\/16\/2014\/08\/4747.Manage_thumb_294E6832.png\" width=\"889\" height=\"306\" \/><\/a> <\/p>\n<\/blockquote>\n<p><strong><\/strong><\/p>\n<ul>\n<li><strong>Add a Phone Number and verify it<\/strong>       \n<ul>\n<li>You need to add a verified phone number before you can use it to get text messages for two-factor authentication. <\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<blockquote>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/aspnet\/wp-content\/uploads\/sites\/16\/2014\/08\/1526.phoneNumberAdded_thumb_14BE9B78.png\"><img decoding=\"async\" title=\"phoneNumberAdded\" style=\"border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px\" border=\"0\" alt=\"phoneNumberAdded\" src=\"https:\/\/devblogs.microsoft.com\/aspnet\/wp-content\/uploads\/sites\/16\/2014\/08\/1526.phoneNumberAdded_thumb_14BE9B78.png\" width=\"804\" height=\"413\" \/><\/a> <\/p>\n<\/blockquote>\n<p><strong><\/strong><\/p>\n<ul>\n<li><strong>Enable Two-Factor Authentication<\/strong>       \n<ul>\n<li>Click on the \u201cTwo-Factor Authentication\u201d to enable it. <\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<blockquote>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/aspnet\/wp-content\/uploads\/sites\/16\/2014\/08\/5824.Enable2FA_thumb_774C4A6B.png\"><img decoding=\"async\" title=\"Enable2FA\" style=\"border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px\" border=\"0\" alt=\"Enable2FA\" src=\"https:\/\/devblogs.microsoft.com\/aspnet\/wp-content\/uploads\/sites\/16\/2014\/08\/5824.Enable2FA_thumb_774C4A6B.png\" width=\"775\" height=\"367\" \/><\/a> <\/p>\n<\/blockquote>\n<p><strong><\/strong><\/p>\n<ul>\n<li><strong>Logout and Login using username and password<\/strong>       \n<ul>\n<li>When you login you will be prompted to select the Two-Factor authentication provider to use to get the code. You can choose between Email, SMS and you can also write your own Two-Factor authentication providers such as QR code generators using Authenticator apps. <\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<blockquote>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/aspnet\/wp-content\/uploads\/sites\/16\/2014\/08\/6013.send2facode_thumb_0928DE39.png\"><img decoding=\"async\" title=\"send2facode\" style=\"border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px\" border=\"0\" alt=\"send2facode\" src=\"https:\/\/devblogs.microsoft.com\/aspnet\/wp-content\/uploads\/sites\/16\/2014\/08\/6013.send2facode_thumb_0928DE39.png\" width=\"818\" height=\"313\" \/><\/a> <\/p>\n<\/blockquote>\n<p><strong><\/strong><\/p>\n<ul>\n<li><strong>Get the code you got through SMS and verify it<\/strong> <\/li>\n<\/ul>\n<blockquote>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/aspnet\/wp-content\/uploads\/sites\/16\/2014\/08\/3364.RememberBrowser_thumb_5DE44731.png\"><img decoding=\"async\" title=\"RememberBrowser\" style=\"border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px\" border=\"0\" alt=\"RememberBrowser\" src=\"https:\/\/devblogs.microsoft.com\/aspnet\/wp-content\/uploads\/sites\/16\/2014\/08\/3364.RememberBrowser_thumb_5DE44731.png\" width=\"800\" height=\"395\" \/><\/a> <\/p>\n<\/blockquote>\n<p><strong><\/strong><\/p>\n<ul>\n<li><strong>Check the Remember the Two-Factor Authentication Option<\/strong>       \n<ul>\n<li>Clicking on the this checkbox will exempt you from needing to use 2FA to log on with that computer and browser. You can do this on any private machine you regularly use. By setting <strong>Remember this browser<\/strong>, you get the added security of 2FA from computers you don&#8217;t regularly use, and you get the convenience on not having to go through 2FA on your own computers. <\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><strong><\/strong><\/p>\n<ul>\n<li><strong>Account Lockout<\/strong>       \n<ul>\n<li>If you enter the code incorrectly then the account will be locked out for 5min after 5 incorrect tries. You will be able to login after 5 min without requiring an Admin action. <\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<blockquote>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/aspnet\/wp-content\/uploads\/sites\/16\/2014\/08\/5722.AccountLockout_thumb_015D8E4B.png\"><img decoding=\"async\" title=\"AccountLockout\" style=\"border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px\" border=\"0\" alt=\"AccountLockout\" src=\"https:\/\/devblogs.microsoft.com\/aspnet\/wp-content\/uploads\/sites\/16\/2014\/08\/5722.AccountLockout_thumb_015D8E4B.png\" width=\"823\" height=\"300\" \/><\/a> <\/p>\n<\/blockquote>\n<p>&#160;<\/p>\n<ul>\n<ul>\n<li>Account Lockout feature in ASP.NET Identity can be configured inside the ApplicationUserManager in App_StartIdentityConfig.cs as follows. <\/li>\n<li id=\"scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:542c4024-5bc9-4463-8e7d-ba81fb5d724c\" class=\"wlWriterSmartContent\" style=\"float: none;padding-bottom: 0px;padding-top: 0px;padding-left: 0px;margin: 0px;padding-right: 0px\">\n<div>\n<div style=\"font-family: verdana, tahoma, arial, sans-serif;background: #000080;font-weight: bold;color: #fff;padding-bottom: 2px;padding-top: 2px;padding-left: 5px;padding-right: 5px\">Code Snippet<\/div>\n<div style=\"overflow: auto;background: #ddd;max-height: 300px\">\n<ol style=\"background: #ffffff;padding-bottom: 0px;padding-top: 0px;padding-left: 5px;margin: 0px 0px 0px 2em;padding-right: 0px\">\n<li><span style=\"background: #ffffff;color: #000000\"><\/span><span style=\"background: #ffffff;color: #008000\">\/\/ Configure user lockout defaults<\/span> <\/li>\n<li style=\"background: #f3f3f3\"><span style=\"background: #ffffff;color: #000000\">manager.UserLockoutEnabledByDefault = <\/span><span style=\"background: #ffffff;color: #0000ff\">true<\/span><span style=\"background: #ffffff;color: #000000\">;<\/span> <\/li>\n<li><span style=\"background: #ffffff;color: #000000\">manager.DefaultAccountLockoutTimeSpan = <\/span><span style=\"background: #ffffff;color: #2b91af\">TimeSpan<\/span><span style=\"background: #ffffff;color: #000000\">.FromMinutes(5);<\/span> <\/li>\n<li style=\"background: #f3f3f3\"><span style=\"background: #ffffff;color: #000000\">manager.MaxFailedAccessAttemptsBeforeLockout = 5;<\/span> <\/li>\n<\/ol><\/div>\n<\/p><\/div>\n<\/li>\n<\/ul>\n<\/ul>\n<p>&#160;<\/p>\n<ul>\n<ul>\n<li>When you enter the two-factor verification code, the <em>VerifyCode<\/em> action uses the <em>SignInManager<\/em> to complete the two-factor <em>SignIn<\/em> process and protects for brute force attacks against the two factor codes.         \n<div id=\"scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:51313488-e7d9-413b-b488-978ee2932920\" class=\"wlWriterEditableSmartContent\" style=\"float: none;padding-bottom: 0px;padding-top: 0px;padding-left: 0px;margin: 0px;padding-right: 0px\">\n<div style=\"border: #000080 1px solid;color: #000;font-family: 'Courier New', Courier, Monospace;font-size: 10pt\">\n<div style=\"background: #000080;color: #fff;font-family: Verdana, Tahoma, Arial, sans-serif;font-weight: bold;padding: 2px 5px\">Code Snippet<\/div>\n<div style=\"background: #ddd;max-height: 300px;overflow: auto\">\n<ol start=\"1\" style=\"background: #ffffff;margin: 0 0 0 2.5em;padding: 0 0 0 5px\">\n<li><span style=\"background:#ffffff;color:#000000\"> <\/span><span style=\"background:#ffffff;color:#008000\">\/\/<\/span><\/li>\n<li style=\"background: #f3f3f3\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"background:#ffffff;color:#000000\"><\/span><span style=\"background:#ffffff;color:#008000\">\/\/ POST: \/Account\/VerifyCode<\/span><\/li>\n<li>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"background:#ffffff;color:#000000\">[<\/span><span style=\"background:#ffffff;color:#2b91af\">HttpPost<\/span><span style=\"background:#ffffff;color:#000000\">]<\/span><\/li>\n<li style=\"background: #f3f3f3\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"background:#ffffff;color:#000000\">[<\/span><span style=\"background:#ffffff;color:#2b91af\">AllowAnonymous<\/span><span style=\"background:#ffffff;color:#000000\">]<\/span><\/li>\n<li>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"background:#ffffff;color:#000000\">[<\/span><span style=\"background:#ffffff;color:#2b91af\">ValidateAntiForgeryToken<\/span><span style=\"background:#ffffff;color:#000000\">]<\/span><\/li>\n<li style=\"background: #f3f3f3\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"background:#ffffff;color:#000000\"><\/span><span style=\"background:#ffffff;color:#0000ff\">public<\/span><span style=\"background:#ffffff;color:#000000\"> <\/span><span style=\"background:#ffffff;color:#0000ff\">async<\/span><span style=\"background:#ffffff;color:#000000\"> <\/span><span style=\"background:#ffffff;color:#2b91af\">Task<\/span><span style=\"background:#ffffff;color:#000000\">&lt;<\/span><span style=\"background:#ffffff;color:#2b91af\">ActionResult<\/span><span style=\"background:#ffffff;color:#000000\">&gt; VerifyCode(<\/span><span style=\"background:#ffffff;color:#2b91af\">VerifyCodeViewModel<\/span><span style=\"background:#ffffff;color:#000000\"> model)<\/span><\/li>\n<li>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"background:#ffffff;color:#000000\">{<\/span><\/li>\n<li style=\"background: #f3f3f3\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"background:#ffffff;color:#000000\"><\/span><span style=\"background:#ffffff;color:#0000ff\">if<\/span><span style=\"background:#ffffff;color:#000000\"> (!ModelState.IsValid)<\/span><\/li>\n<li>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"background:#ffffff;color:#000000\">{<\/span><\/li>\n<li style=\"background: #f3f3f3\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"background:#ffffff;color:#000000\"><\/span><span style=\"background:#ffffff;color:#0000ff\">return<\/span><span style=\"background:#ffffff;color:#000000\"> View(model);<\/span><\/li>\n<li>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"background:#ffffff;color:#000000\">}<\/span><\/li>\n<li style=\"background: #f3f3f3\">&nbsp;<\/li>\n<li>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"background:#ffffff;color:#000000\"><\/span><span style=\"background:#ffffff;color:#008000\">\/\/ The following code protects for brute force attacks against the two factor codes. <\/span><\/li>\n<li style=\"background: #f3f3f3\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"background:#ffffff;color:#000000\"><\/span><span style=\"background:#ffffff;color:#008000\">\/\/ If a user enters incorrect codes for a specified amount of time then the user account <\/span><\/li>\n<li>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"background:#ffffff;color:#000000\"><\/span><span style=\"background:#ffffff;color:#008000\">\/\/ will be locked out for a specified amount of time. <\/span><\/li>\n<li style=\"background: #f3f3f3\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"background:#ffffff;color:#000000\"><\/span><span style=\"background:#ffffff;color:#008000\">\/\/ You can configure the account lockout settings in IdentityConfig<\/span><\/li>\n<li>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"background:#ffffff;color:#000000\"><\/span><span style=\"background:#ffffff;color:#0000ff\">var<\/span><span style=\"background:#ffffff;color:#000000\"> result = <\/span><span style=\"background:#ffffff;color:#0000ff\">await<\/span><span style=\"background:#ffffff;color:#000000\"> SignInManager.TwoFactorSignInAsync(<\/span><\/li>\n<li style=\"background: #f3f3f3\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"background:#ffffff;color:#000000\">model.Provider, model.Code, isPersistent:\u00a0\u00a0model.RememberMe, <\/span><\/li>\n<li>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"background:#ffffff;color:#000000\">rememberBrowser: model.RememberBrowser);<\/span><\/li>\n<li style=\"background: #f3f3f3\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"background:#ffffff;color:#000000\"><\/span><span style=\"background:#ffffff;color:#0000ff\">switch<\/span><span style=\"background:#ffffff;color:#000000\"> (result)<\/span><\/li>\n<li>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"background:#ffffff;color:#000000\">{<\/span><\/li>\n<li style=\"background: #f3f3f3\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"background:#ffffff;color:#000000\"><\/span><span style=\"background:#ffffff;color:#0000ff\">case<\/span><span style=\"background:#ffffff;color:#000000\"> <\/span><span style=\"background:#ffffff;color:#2b91af\">SignInStatus<\/span><span style=\"background:#ffffff;color:#000000\">.Success:<\/span><\/li>\n<li>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"background:#ffffff;color:#000000\"><\/span><span style=\"background:#ffffff;color:#0000ff\">return<\/span><span style=\"background:#ffffff;color:#000000\"> RedirectToLocal(model.ReturnUrl);<\/span><\/li>\n<li style=\"background: #f3f3f3\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"background:#ffffff;color:#000000\"><\/span><span style=\"background:#ffffff;color:#0000ff\">case<\/span><span style=\"background:#ffffff;color:#000000\"> <\/span><span style=\"background:#ffffff;color:#2b91af\">SignInStatus<\/span><span style=\"background:#ffffff;color:#000000\">.LockedOut:<\/span><\/li>\n<li>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"background:#ffffff;color:#000000\"><\/span><span style=\"background:#ffffff;color:#0000ff\">return<\/span><span style=\"background:#ffffff;color:#000000\"> View(<\/span><span style=\"background:#ffffff;color:#a31515\">&quot;Lockout&quot;<\/span><span style=\"background:#ffffff;color:#000000\">);<\/span><\/li>\n<li style=\"background: #f3f3f3\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"background:#ffffff;color:#000000\"><\/span><span style=\"background:#ffffff;color:#0000ff\">case<\/span><span style=\"background:#ffffff;color:#000000\"> <\/span><span style=\"background:#ffffff;color:#2b91af\">SignInStatus<\/span><span style=\"background:#ffffff;color:#000000\">.Failure:<\/span><\/li>\n<li>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"background:#ffffff;color:#000000\"><\/span><span style=\"background:#ffffff;color:#0000ff\">default<\/span><span style=\"background:#ffffff;color:#000000\">:<\/span><\/li>\n<li style=\"background: #f3f3f3\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"background:#ffffff;color:#000000\">ModelState.AddModelError(<\/span><span style=\"background:#ffffff;color:#a31515\">&quot;&quot;<\/span><span style=\"background:#ffffff;color:#000000\">, <\/span><span style=\"background:#ffffff;color:#a31515\">&quot;Invalid code.&quot;<\/span><span style=\"background:#ffffff;color:#000000\">);<\/span><\/li>\n<li>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"background:#ffffff;color:#000000\"><\/span><span style=\"background:#ffffff;color:#0000ff\">return<\/span><span style=\"background:#ffffff;color:#000000\"> View(model);<\/span><\/li>\n<li style=\"background: #f3f3f3\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"background:#ffffff;color:#000000\">}<\/span><\/li>\n<li>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"background:#ffffff;color:#000000\">}<\/span><\/li>\n<\/ol><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/li>\n<\/ul>\n<\/ul>\n<ul>\n<ul>\n<ul>&#160;<\/ul>\n<\/ul>\n<\/ul>\n<h3>Samples\/ Documentation<\/h3>\n<ul>\n<ul>\n<li>We have lots of samples for Identity at <a href=\"https:\/\/aspnet.codeplex.com\/\">https:\/\/aspnet.codeplex.com<\/a>. Please look for the Identity folder in the source. <a href=\"https:\/\/aspnet.codeplex.com\/SourceControl\/latest\">https:\/\/aspnet.codeplex.com\/SourceControl\/latest<\/a> <\/li>\n<li>For documentation on ASP.NET Identity please visit <a href=\"http:\/\/www.asp.net\/identity\">http:\/\/www.asp.net\/identity<\/a>. <\/li>\n<li><a href=\"http:\/\/www.asp.net\/identity\/overview\/features-api\/account-confirmation-and-password-recovery-with-aspnet-identity\">Account Confirmation and password recovery<\/a><\/li>\n<li><a href=\"http:\/\/www.asp.net\/identity\/overview\/features-api\/two-factor-authentication-using-sms-and-email-with-aspnet-identity\">Two-Factor Authentication<\/a><\/li>\n<li><a href=\"http:\/\/www.asp.net\/identity\/overview\/migrations\">Migrating from Membership to Identity<\/a><\/li>\n<li><a href=\"http:\/\/www.asp.net\/identity\/overview\/getting-started\/aspnet-identity-recommended-resources\">ASP.NET Identity Recommended resources<\/a>&#160; <\/li>\n<\/ul>\n<\/ul>\n<h3>Migrating from ASP.NET Identity 2.0.0<\/h3>\n<p>This is a compatible release with 2.0.0 and there are no database schema changes with this release.<\/p>\n<h3>Give feedback and get support<\/h3>\n<ul>\n<ul>\n<li>If you find any bugs please open them at our Codeplex Site where we track all our bugs <a href=\"https:\/\/aspnetidentity.codeplex.com\/\">https:\/\/aspnetidentity.codeplex.com\/<\/a> <\/li>\n<li>If you want to discuss these features or have questions, please discuss them on Stack Overflow and use the following tag \u201casp.net-identity\u201d <\/li>\n<\/ul>\n<\/ul>\n<p>The ASP.NET Identity team would like to thank you for trying out this release and your feedback for ASP.NET Identity. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>We are releasing RTM of ASP.NET Identity 2.1.0. The main focus in this release was to fix bugs and add SignInManager to make it easier to use security features such as Account Lockout, Two-Factor Authentication for login. ASP.NET Identity 2.1 is included in the ASP.NET templates which were released with VS 2013 Update 3. The [&hellip;]<\/p>\n","protected":false},"author":408,"featured_media":58792,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[197],"tags":[7434,7467,7480],"class_list":["post-334","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-aspnet","tag-asp-net-4-5","tag-asp-net-identity","tag-asp-net-mv"],"acf":[],"blog_post_summary":"<p>We are releasing RTM of ASP.NET Identity 2.1.0. The main focus in this release was to fix bugs and add SignInManager to make it easier to use security features such as Account Lockout, Two-Factor Authentication for login. ASP.NET Identity 2.1 is included in the ASP.NET templates which were released with VS 2013 Update 3. The [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/334","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/users\/408"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/comments?post=334"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/334\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media\/58792"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media?parent=334"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/categories?post=334"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/tags?post=334"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}