title: How do I construct Claims after successful ADFS authentication?
body: <p>Our app redirects to an external ADFS login for auth then routes back to us. I'm trying to figure out how I parse out the claims info once it returns to our site. The trouble I've run into is finding a working example for .NET Core 2.1. Here is what I have:</p>
  
  <pre><code>services.AddAuthentication(sharedOptions =&gt; {
                  sharedOptions.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme;
                  sharedOptions.DefaultSignInScheme = CookieAuthenticationDefaults.AuthenticationScheme;
                  sharedOptions.DefaultChallengeScheme = WsFederationDefaults.AuthenticationScheme;
              })
                 .AddWsFederation(options =&gt; {                   
                     options.MetadataAddress = config.Authentication.ADFSMetadataAddress;
                     options.Wtrealm = config.Authentication.ADFSWtrealm;
                     options.CallbackPath = "/Auth";
                 }).AddCookie();
  </code></pre>
  
  <p>This part works fine, I can login and get sent back to my application. The examples on the Microsoft documentation show implementing a custom <code>ClaimsAuthenticationManager</code> like this to extract the claims info:</p>
  
  <pre><code>public class MyClaimsAuthenticationManager : ClaimsAuthenticationManager {
          public override ClaimsPrincipal Authenticate(string resourceName, ClaimsPrincipal incomingPrincipal) {
              if (incomingPrincipal != null &amp;&amp; incomingPrincipal.Identity.IsAuthenticated == true) {
                  ((ClaimsIdentity)incomingPrincipal.Identity).AddClaim(new Claim(ClaimTypes.Role, "Admin"));
              }
          return incomingPrincipal;
      }
  }
  </code></pre>
  
  <p>But it cannot find that base class in .NET Core. I tried adding NuGet packages for:</p>
  
  <pre><code>Microsoft.AspNetCore.Identity
  Microsoft.Extensions.Identity.Core
  </code></pre>
  
  <p>and even </p>
  
  <pre><code>System.Security.Claims
  </code></pre>
  
  <p>but no dice...is there another way to accomplish this in .NET Core?</p>