title: unable to Hit that Action in MVC, once we add [Authorize] Key word on top of controller
body: <p>Soon after we add the <code>[Authorize]</code> key word on top of that Action of that action is not been called.</p>
  
  <p>Here is the MVC code:
  </p>
  
  <pre class="lang-cs prettyprint-override"><code>[HttpGet]
  [Authorize]
  //[ActionName("GetCoolingScheduleData")]
  public MillSchedule GetMillScheduleData(int id)
  {
      cmd.CommandType = CommandType.Text;
      conn.ConnectionString = connectionString;
      cmd.CommandText = " select * from TBL_MILL_SCHEDULE where id=" + id + "";
      cmd.Connection = conn;
      conn.Open();
      reader = cmd.ExecuteReader();
      MillSchedule mvm = null;
  
      while (reader.Read())
      {
          mvm = new MillSchedule();
          mvm.id = Convert.ToInt32(reader.GetValue(0));
  
          mvm.rFactor1 = Convert.ToInt32(reader.GetValue(1));
          mvm.rFactor2 = Convert.ToInt32(reader.GetValue(2));
          mvm.rFactor3 = Convert.ToInt32(reader.GetValue(3));
      }
      return mvm;
  }
  </code></pre>
  
  <p>I am testing using the API Testing tool POSTMAN,</p>
  
  <p>HTTPPOST:--><a href="http://localhost:51916/api/L2AppApi/GetMillScheduleData/1" rel="nofollow noreferrer">http://localhost:51916/api/L2AppApi/GetMillScheduleData/1</a></p>
  
  <pre class="lang-none prettyprint-override"><code>Token&gt;&gt;&gt;
  eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1bmlxdWVfbmFtZSI6InRlc3QiLCJuYmYiOjE1Mzk3Njc2MDYsImV4cCI6MTU0MDM3MjQwNywiaWF0IjoxNTM5NzY3NjE0LCJpc3MiOiJodHRwOi8vbG9jYWxob3N0OjUxOTE2IiwiYXVkIjoiaHR0cDovL2xvY2FsaG9zdDo1MTkxNiJ9.CVS9YsjVo_-PWrHjnZjBiS6ugkWIu0FQBtRYq-fYF0E
  </code></pre>
  
  <p>the Above token is been created Soon after the Login </p>
  
  <p>the Login will Call and Method Like Create Token .</p>
  
  <pre class="lang-cs prettyprint-override"><code>private string createToken(string username)
  {
      //Set issued at date
      DateTime issuedAt = DateTime.UtcNow;
      //set the time when it expires
      DateTime expires = DateTime.UtcNow.AddDays(7);
  
      var tokenHandler = new JwtSecurityTokenHandler();
  
      //create a identity and add claims to the user which we want to log in
      ClaimsIdentity claimsIdentity = new ClaimsIdentity(new[]
      {
          new Claim(ClaimTypes.Name, username)
      });
  
      const string sec = "401b09eab3c013d4ca54922bb802bec8fd5318192b0a75f201d8b3727429090fb337591abd3e44453b954555b7a0812e1081c39b740293f765eae731f5a65ed1";
      var now = DateTime.UtcNow;
      var securityKey = new Microsoft.IdentityModel.Tokens.SymmetricSecurityKey(
          System.Text.Encoding.Default.GetBytes(sec));
      var signingCredentials = new Microsoft.IdentityModel.Tokens.SigningCredentials(
          securityKey,
          Microsoft.IdentityModel.Tokens.SecurityAlgorithms.HmacSha256Signature);
  
      //create the jwt
      var token = (JwtSecurityToken) tokenHandler.CreateJwtSecurityToken(
          issuer: "http://localhost:51916",
          audience: "http://localhost:51916",
          subject: claimsIdentity,
          notBefore: issuedAt,
          expires: expires,
          signingCredentials: signingCredentials);
          var tokenString = tokenHandler.WriteToken(token);
  
      return tokenString;
  }
  </code></pre>