title: C# - How to add user claims/roles from JWT on Web API 2
body: <p>I am trying to setup client authorization in my application. My final objective is to make an HTTP request to an API that will return a list of claims for given user. Unfortunately I can't seem to figure out how to add claims to the Claims Identity.</p>
  
  <p>Here's what I am trying in the <code>Global.asax</code>:</p>
  
  <pre><code>protected void Application_AuthenticateRequest(Object sender, EventArgs e)
  {
      if (HttpContext.Current.User != null)
      {
          if (HttpContext.Current.User.Identity.IsAuthenticated)
          {
              var claimsIdentity = (ClaimsIdentity)HttpContext.Current.User.Identity;
              var identity = new ClaimsIdentity(claimsIdentity);
              identity.AddClaim(new Claim(ClaimTypes.Role, "Admin"));
          }
      }
  }
  </code></pre>
  
  <p>Then in my controller:</p>
  
  <pre><code>[HttpGet]
  [Route("test")]
  [Authorize(Roles = ("Admin"))]
  public IHttpActionResult GetClaims()
  {
      return Ok("Success");
  }
  </code></pre>
  
  <p>And finally this is the response <code>401 - Unauthorized</code>:</p>
  
  <pre><code>{
      "message": "Authorization has been denied for this request."
  }
  </code></pre>
  
  <p>Any suggestions?</p>