1

I have a Web API that recieves http requestes, everything appears to work fine in localhost but when the web api was deployed there were issues using the bearer token to authorize users for the requests.

The token is generated correctly i think, and the first requests are gone through authorize attribute, but after a while, token is invalid. why this happens ? Any ideas, it is something that has to do with app pool recycle on IIS , or something has changed form localhost when deployed?

dorianmusaj
  • 56
  • 1
  • 7
  • How do you know that the token is invalid? Is it expired? Can you check the expiry date of the token when you first receive it? – Jinish Mar 29 '17 at 11:17
  • I have made a controller method just to check if the status of request made with this token and it is 200 (ok)..after a while it gets 401 (unauthorized). i test it with postman – dorianmusaj Mar 29 '17 at 12:35
  • And whats the expiry date on the token when you first generate it? – Jinish Mar 29 '17 at 12:39
  • 1 day, the token is valid for one day – dorianmusaj Mar 30 '17 at 08:00
  • You might want to have a look at this: http://stackoverflow.com/questions/28480848/asp-net-web-api-authorization-tokens-expiring-early – Jinish Mar 30 '17 at 11:13

0 Answers0