title: User.IsInRole always returns false with Token Authentication
body: <p>I have ASP.NET Core 2 configured to use JWT Tokens to authenticate. The configuration looks like this:</p>
  
  <pre><code>services.AddAuthentication(options =&gt;
      {
          options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme;
          options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;
          options.DefaultSignInScheme = JwtBearerDefaults.AuthenticationScheme;
  
      })
      .AddJwtBearer(options =&gt;
      {
          options.RequireHttpsMetadata = false;
          options.SaveToken = true;
  
          options.TokenValidationParameters = new TokenValidationParameters
          {
              ValidIssuer = Configuration["Tokens:Issuer"],
              ValidAudience = Configuration["Tokens:Issuer"],
              IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(Configuration["Tokens:Key"]))
          };
      });
  </code></pre>
  
  <p>Then I created a method where a user signs in which looks like this:</p>
  
  <pre><code>[AllowAnonymous]
  [HttpPost]
  [Route("token")]
  public async Task&lt;IActionResult&gt; Token([FromBody] LoginViewModel model)
  {
      if (!ModelState.IsValid) return BadRequest("Could not create token");
  
      var user = await _userManager.FindByNameAsync(model.UserName);
  
      if (user == null) return BadRequest("Could not create token");
      var result = await _signInManager.CheckPasswordSignInAsync(user, model.Password, false);
      if (!result.Succeeded) return BadRequest("Could not create token");
      var claims = new[]
      {
          new Claim(JwtRegisteredClaimNames.Sub, user.Email),
          new Claim(JwtRegisteredClaimNames.Jti, Guid.NewGuid().ToString()),
      };
  
      var key = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(_configuration["Tokens:Key"]));
      var creds = new SigningCredentials(key, SecurityAlgorithms.HmacSha256);
  
      var roles = await _userManager.GetRolesAsync(user);
  
      var token = new JwtSecurityToken(_configuration["Tokens:Issuer"],
          _configuration["Tokens:Issuer"],
          claims,
          expires: DateTime.Now.AddMinutes(30),
          signingCredentials: creds);
  
      return Ok(new {
          access_token = new JwtSecurityTokenHandler().WriteToken(token),
          roles });
  }
  </code></pre>
  
  <p>}</p>
  
  <p>I save the token and use it in my request. I have a very simple api endpoint:</p>
  
  <pre><code>[HttpGet("users")]
  [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)]
  public IActionResult GetUsers()
  {
      var isInRole = HttpContext.User.IsInRole(Roles.Administrator);
      return Ok(_service.GetAllUsers());
  }
  </code></pre>
  
  <p>Here I get in the method, but <code>isInRole</code> is always false. Even though my <code>var roles = await _userManager.GetRolesAsync(user);</code> returns a list of roles including Administrator. Why does this not work then?</p>