From 7b8ace548986bfb4313a6cff94e3ffd4566df5f4 Mon Sep 17 00:00:00 2001 From: Praburaj Date: Tue, 3 Mar 2015 16:49:00 -0800 Subject: [PATCH] Re-enable the Ntlm authentication tests User.IsSignedIn() does not return true for NTLM. So pulling the NTLM check out of the code block. --- .../Views/Shared/_LoginPartial.cshtml | 31 +++++++++---------- test/E2ETests/NtlmAuthentationTest.cs | 2 +- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/src/MusicStore/Views/Shared/_LoginPartial.cshtml b/src/MusicStore/Views/Shared/_LoginPartial.cshtml index b539905a3b..6abadf073f 100644 --- a/src/MusicStore/Views/Shared/_LoginPartial.cshtml +++ b/src/MusicStore/Views/Shared/_LoginPartial.cshtml @@ -2,31 +2,28 @@ @if (User.IsSignedIn()) { - //Either NTLM will be used or social authentication will be used. Based on the authentication schemes enabled remove an unused block. - if (User.Identity.AuthenticationType != "NTLM") + using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new { id = "logoutForm", @class = "navbar-right" })) { - using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new { id = "logoutForm", @class = "navbar-right" })) - { - @Html.AntiForgeryToken() + @Html.AntiForgeryToken() - - } - } - else - { - //This code block necessary only for NTLM authentication } } +//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 + +} else {