Skip to content

Instantly share code, notes, and snippets.

@andrewconnell
Created December 17, 2014 15:50
Show Gist options
  • Select an option

  • Save andrewconnell/46d92f4c5c8a826fda5a to your computer and use it in GitHub Desktop.

Select an option

Save andrewconnell/46d92f4c5c8a826fda5a to your computer and use it in GitHub Desktop.
Azure AD & ASP.NET MVC - Walk-Through Implementing ADAL & OWIN - _LoginPartial.cshtml
@if (Request.IsAuthenticated) {
<text>
<ul class="nav navbar-nav navbar-right">
<li class="navbar-text">
Hello, @User.Identity.Name!
</li>
<li>
@Html.ActionLink("Sign out", "SignOut", "Account")
</li>
</ul>
</text>
} else {
<ul class="nav navbar-nav navbar-right">
<li>@Html.ActionLink("Sign in", "SignIn", "Account", routeValues: null, htmlAttributes: new { id = "loginLink" })</li>
</ul>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment