title: .NET CORE and ADFS no Claims Available
body: <p>Migrating to .NET Core 3 from a 4.6 project and I'm not 100% sure I am implementing things properly. </p>
  
  <p>I followed the steps in this article, making sure to configure startup.cs following the code sample under the "Use WS-Federation without ASP.NET Core Identity" section. 
  <a href="https://docs.microsoft.com/en-us/aspnet/core/security/authentication/ws-federation?view=aspnetcore-3.0" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/aspnet/core/security/authentication/ws-federation?view=aspnetcore-3.0</a></p>
  
  <p>Login seems to be working in that I'm redirected to MS login and sent back to my app with the expected cookies, for example MSISAuthenticated. But, user.identity.isauthenticated is always false and I have no claims available. Is this expected behavior? Perhaps I'm not configuring things properly? Ideally I'd like to be able to check if a user is authenticated and access the claims.</p>
  
  <p>I've come across a number of articles about adding policies based on groups, but how would [Authorize (Policy="SomeGroup")] even work if no claims are available?</p>
  
  <p>ConfigureServices Code:
  <a href="https://i.stack.imgur.com/msNDi.png" rel="nofollow noreferrer">enter image description here</a></p>
  
  <p>Configure Code:
  <a href="https://i.stack.imgur.com/yurSP.png" rel="nofollow noreferrer">enter image description here</a></p>
  
  <p>Controller Action:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>        public IActionResult Index()
          {
              var identity = (ClaimsIdentity)User.Identity;
              ViewBag.Claims = identity.Claims;
  
              return View();
          }</code></pre>
  </div>
  </div>
  </p>
  
  <p>View Code:
  <div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>@using System.Security.Claims;
  @{
      ViewBag.Title = "Home Page";
      IEnumerable&lt;Claim&gt; claims = (IEnumerable&lt;Claim&gt;)ViewBag.Claims;
  }
  
  @if (User.Identity.IsAuthenticated)
  {
      &lt;div class="jumbotron"&gt;
          &lt;h1&gt;Successful Sign On!&lt;/h1&gt;
      &lt;/div&gt;
  
      &lt;div class="row"&gt;
          &lt;div class="col-md-12"&gt;
              &lt;h2&gt;WS Federation Services Claims&lt;/h2&gt;
              @foreach (Claim claim in claims)
              {
                  &lt;p&gt;
                      &lt;b&gt;@(claim.Type.ToString())&lt;/b&gt;
                      &lt;br /&gt;
                      @(claim.Value.ToString()) (type: @(claim.ValueType.ToString()))
                      &lt;hr /&gt;
                  &lt;/p&gt;
              }
          &lt;/div&gt;
      &lt;/div&gt;
  }
  else
  {
      &lt;div class="jumbotron"&gt;
          &lt;h1&gt;SSO Test&lt;/h1&gt;
          &lt;p class="lead"&gt;To sign in using Microsoft's single sign-on service, click the button below.&lt;/p&gt;
          &lt;p&gt;&lt;a href="/account/signin" class="btn btn-primary btn-lg"&gt;Sign in &amp;raquo;&lt;/a&gt;&lt;/p&gt;
      &lt;/div&gt;
  }</code></pre>
  </div>
  </div>
  </p>