Microsoft Security Advisory 3137909
This commit is contained in:
parent
24b224e046
commit
57307ef2b7
|
|
@ -176,7 +176,8 @@ namespace IdentitySamples.Controllers
|
||||||
|
|
||||||
//
|
//
|
||||||
// GET: /Manage/RemovePhoneNumber
|
// GET: /Manage/RemovePhoneNumber
|
||||||
[HttpGet]
|
[HttpPost]
|
||||||
|
[ValidateAntiForgeryToken]
|
||||||
public async Task<IActionResult> RemovePhoneNumber()
|
public async Task<IActionResult> RemovePhoneNumber()
|
||||||
{
|
{
|
||||||
var user = await GetCurrentUserAsync();
|
var user = await GetCurrentUserAsync();
|
||||||
|
|
|
||||||
|
|
@ -5,30 +5,26 @@
|
||||||
|
|
||||||
<h2>@ViewData["Title"].</h2>
|
<h2>@ViewData["Title"].</h2>
|
||||||
<p class="text-success">@ViewData["StatusMessage"]</p>
|
<p class="text-success">@ViewData["StatusMessage"]</p>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<h4>Change your account settings</h4>
|
<h4>Change your account settings</h4>
|
||||||
<hr />
|
<hr />
|
||||||
<dl class="dl-horizontal">
|
<dl class="dl-horizontal">
|
||||||
<dt>Password:</dt>
|
<dt>Password:</dt>
|
||||||
<dd>
|
<dd>
|
||||||
[
|
|
||||||
@if (Model.HasPassword)
|
@if (Model.HasPassword)
|
||||||
{
|
{
|
||||||
<a asp-controller="Manage" asp-action="ChangePassword">Change</a>
|
<text>[ <a asp-controller="Manage" asp-action="ChangePassword">Change</a> ]</text>
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<a asp-controller="Manage" asp-action="SetPassword">Create</a>
|
<text>[ <a asp-controller="Manage" asp-action="SetPassword">Create</a> ]</text>
|
||||||
}
|
}
|
||||||
]
|
|
||||||
</dd>
|
</dd>
|
||||||
<dt>External Logins:</dt>
|
<dt>External Logins:</dt>
|
||||||
<dd>
|
<dd>
|
||||||
|
@Model.Logins.Count [ <a asp-controller="Manage" asp-action="ManageLogins">Manage</a> ]
|
||||||
@Model.Logins.Count [ <a asp-controller="Manage" asp-action="ManageLogins">Manage</a> ]
|
|
||||||
</dd>
|
</dd>
|
||||||
|
|
||||||
|
|
||||||
<dt>Phone Number:</dt>
|
<dt>Phone Number:</dt>
|
||||||
<dd>
|
<dd>
|
||||||
<p>
|
<p>
|
||||||
|
|
@ -36,18 +32,19 @@
|
||||||
See <a href="http://go.microsoft.com/fwlink/?LinkID=532713">this article</a>
|
See <a href="http://go.microsoft.com/fwlink/?LinkID=532713">this article</a>
|
||||||
for details on setting up this ASP.NET application to support two-factor authentication using SMS.
|
for details on setting up this ASP.NET application to support two-factor authentication using SMS.
|
||||||
</p>
|
</p>
|
||||||
@*@(Model.PhoneNumber ?? "None") [
|
@*@(Model.PhoneNumber ?? "None")
|
||||||
@if (Model.PhoneNumber != null)
|
@if (Model.PhoneNumber != null)
|
||||||
{
|
{
|
||||||
<a asp-controller="Manage" asp-action="AddPhoneNumber">Change</a>
|
<br />
|
||||||
@: |
|
<text>[ <a asp-controller="Manage" asp-action="AddPhoneNumber">Change</a> ]</text>
|
||||||
<a asp-controller="Manage" asp-action="RemovePhoneNumber">Remove</a>
|
<form asp-controller="Manage" asp-action="RemovePhoneNumber" method="post" role="form">
|
||||||
|
[<button type="submit" class="btn-link">Remove</button>]
|
||||||
|
</form>
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<a asp-controller="Manage" asp-action="AddPhoneNumber">Add</a>
|
<text>[ <a asp-controller="Manage" asp-action="AddPhoneNumber">Add</a> ]</text>
|
||||||
}
|
}*@
|
||||||
]*@
|
|
||||||
</dd>
|
</dd>
|
||||||
|
|
||||||
<dt>Two-Factor Authentication:</dt>
|
<dt>Two-Factor Authentication:</dt>
|
||||||
|
|
@ -59,19 +56,13 @@
|
||||||
@*@if (Model.TwoFactor)
|
@*@if (Model.TwoFactor)
|
||||||
{
|
{
|
||||||
<form asp-controller="Manage" asp-action="DisableTwoFactorAuthentication" method="post" class="form-horizontal" role="form">
|
<form asp-controller="Manage" asp-action="DisableTwoFactorAuthentication" method="post" class="form-horizontal" role="form">
|
||||||
<text>
|
Enabled [<button type="submit" class="btn-link">Disable</button>]
|
||||||
Enabled
|
|
||||||
<button type="submit" class="btn btn-link">Disable</button>
|
|
||||||
</text>
|
|
||||||
</form>
|
</form>
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<form asp-controller="Manage" asp-action="EnableTwoFactorAuthentication" method="post" class="form-horizontal" role="form">
|
<form asp-controller="Manage" asp-action="EnableTwoFactorAuthentication" method="post" class="form-horizontal" role="form">
|
||||||
<text>
|
[<button type="submit" class="btn-link">Enable</button>] Disabled
|
||||||
Disabled
|
|
||||||
<button type="submit" class="btn btn-link">Enable</button>
|
|
||||||
</text>
|
|
||||||
</form>
|
</form>
|
||||||
}*@
|
}*@
|
||||||
</dd>
|
</dd>
|
||||||
|
|
|
||||||
|
|
@ -196,6 +196,8 @@ namespace Interop45.Controllers
|
||||||
|
|
||||||
//
|
//
|
||||||
// GET: /Manage/RemovePhoneNumber
|
// GET: /Manage/RemovePhoneNumber
|
||||||
|
[HttpPost]
|
||||||
|
[ValidateAntiForgeryToken]
|
||||||
public async Task<ActionResult> RemovePhoneNumber()
|
public async Task<ActionResult> RemovePhoneNumber()
|
||||||
{
|
{
|
||||||
var result = await UserManager.SetPhoneNumberAsync(User.Identity.GetUserId(), null);
|
var result = await UserManager.SetPhoneNumberAsync(User.Identity.GetUserId(), null);
|
||||||
|
|
|
||||||
|
|
@ -39,18 +39,17 @@
|
||||||
@*
|
@*
|
||||||
<dt>Phone Number:</dt>
|
<dt>Phone Number:</dt>
|
||||||
<dd>
|
<dd>
|
||||||
@(Model.PhoneNumber ?? "None") [
|
@(If(Model.PhoneNumber, "None"))
|
||||||
@if (Model.PhoneNumber != null)
|
@If (Model.PhoneNumber <> Nothing) Then
|
||||||
{
|
@<br />
|
||||||
@Html.ActionLink("Change", "AddPhoneNumber")
|
@<text>[ @Html.ActionLink("Change", "AddPhoneNumber") ]</text>
|
||||||
@: |
|
@Using Html.BeginForm("RemovePhoneNumber", "Manage", FormMethod.Post, New With {.class = "form-horizontal", .role = "form"})
|
||||||
@Html.ActionLink("Remove", "RemovePhoneNumber")
|
@Html.AntiForgeryToken
|
||||||
}
|
@<text>[<input type="submit" value="Remove" class="btn-link" />]</text>
|
||||||
else
|
End Using
|
||||||
{
|
Else
|
||||||
@Html.ActionLink("Add", "AddPhoneNumber")
|
@<text>[ @Html.ActionLink("Add", "AddPhoneNumber") ]</text>
|
||||||
}
|
End If
|
||||||
]
|
|
||||||
</dd>
|
</dd>
|
||||||
*@
|
*@
|
||||||
<dt>Two-Factor Authentication:</dt>
|
<dt>Two-Factor Authentication:</dt>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue