title: How to include claims in JWT token?
body: <p>Hi I am developing web application in .Net core. I have implemented V2 Authentication. Now I have requirement to add Authorization. The requirement states that First,</p>
  
  <blockquote>
    <p>It should not be the job of the application to gather the claims of
    the user, they should be available in the users JWT. Second, 
    Permissions with an application will be granted based on claims.</p>
  </blockquote>
  
  <p>Below is my authentication code.</p>
  
  <pre><code> services
                 .AddAuthentication(o =&gt;
                 {
                     o.DefaultScheme = JwtBearerDefaults.AuthenticationScheme;
  
                 })
                 .AddJwtBearer(o =&gt;
                 {
                     o.Authority = azureActiveDirectoryOptions.Authority;
  
                     o.TokenValidationParameters = new TokenValidationParameters
                     {
  
                         ValidAudiences = new List&lt;string&gt;
                         {
                            azureActiveDirectoryOptions.AppIdUri,
                            azureActiveDirectoryOptions.ClientId
                         },
                     };
                 });
  
              services.AddMvc(options =&gt;
              {
  
                  var policy = new AuthorizationPolicyBuilder()
                      .RequireAuthenticatedUser()
                      .Build();
                  options.Filters.Add(new AuthorizeFilter(policy));
              }).SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
  </code></pre>
  
  <p>Can someone help me to add claims based Authorization? Any help would be greatly appreciated. Thanks</p>