Re-enable the Ntlm authentication tests

User.IsSignedIn() does not return true for NTLM. So pulling the NTLM check out of the code block.
This commit is contained in:
Praburaj 2015-03-03 16:49:00 -08:00
parent 1df35b8e8b
commit 7b8ace5489
2 changed files with 15 additions and 18 deletions

View File

@ -2,31 +2,28 @@
@if (User.IsSignedIn()) @if (User.IsSignedIn())
{ {
//Either NTLM will be used or social authentication will be used. Based on the authentication schemes enabled remove an unused block. using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new { id = "logoutForm", @class = "navbar-right" }))
if (User.Identity.AuthenticationType != "NTLM")
{ {
using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new { id = "logoutForm", @class = "navbar-right" })) @Html.AntiForgeryToken()
{
@Html.AntiForgeryToken()
<ul class="nav navbar-nav navbar-right">
<li>
@Html.ActionLink("Hello " + User.GetUserName() + "!", "Index", "Manage", routeValues: null, htmlAttributes: new { title = "Manage" })
</li>
<li><a href="javascript:document.getElementById('logoutForm').submit()">Log off</a></li>
</ul>
}
}
else
{
//This code block necessary only for NTLM authentication
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">
<li> <li>
<p class="nav navbar-text navbar-right">Hello, @User.GetUserName()!</p> @Html.ActionLink("Hello " + User.GetUserName() + "!", "Index", "Manage", routeValues: null, htmlAttributes: new { title = "Manage" })
</li> </li>
<li><a href="javascript:document.getElementById('logoutForm').submit()">Log off</a></li>
</ul> </ul>
} }
} }
//Either NTLM will be used or social authentication will be used. Based on the authentication schemes enabled remove an unused block.
else if (User.Identity.IsAuthenticated && User.Identity.AuthenticationType == "NTLM")
{
//This code block necessary only for NTLM authentication
<ul class="nav navbar-nav navbar-right">
<li>
<p class="nav navbar-text navbar-right">Hello, @User.GetUserName()!</p>
</li>
</ul>
}
else else
{ {
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">

View File

@ -10,7 +10,7 @@ namespace E2ETests
{ {
public partial class SmokeTests public partial class SmokeTests
{ {
[ConditionalTheory(Skip = "Auth changes broke this, haok investigating")] [ConditionalTheory]
[OSSkipCondition(OperatingSystems.Unix | OperatingSystems.MacOSX)] [OSSkipCondition(OperatingSystems.Unix | OperatingSystems.MacOSX)]
//[InlineData(ServerType.IISExpress, RuntimeFlavor.CoreClr, RuntimeArchitecture.x86, "http://localhost:5001/")] //[InlineData(ServerType.IISExpress, RuntimeFlavor.CoreClr, RuntimeArchitecture.x86, "http://localhost:5001/")]
[InlineData(ServerType.IISExpress, RuntimeFlavor.DesktopClr, RuntimeArchitecture.amd64, "http://localhost:5001/")] [InlineData(ServerType.IISExpress, RuntimeFlavor.DesktopClr, RuntimeArchitecture.amd64, "http://localhost:5001/")]