1

ASP.net has many approach how to implement token authentication without need of user.

For me I want a direct approach to do this as my first time to implement this still searching for the right middleware approach as of now but hoping everyone can help.

I am needed to add a 24 hr session to my application which require check token every request if token is expired should return 401

as my first time to implement in asp.net core 2.1 I want to ask your help if how I could implement that in the back end

when user is created the token is given and every request my middleware should check how many time left before the token expire

Any help would be appreciated

Yabetsu2018
  • 133
  • 1
  • 15
  • 2
    Already answered here: https://stackoverflow.com/questions/51334572/jwt-token-expiration-time-asp-net-core – Neil Aug 15 '18 at 16:02
  • Thanks Neil for this link , also I am thinking to use delegateHandler for the token check as well – Yabetsu2018 Aug 15 '18 at 23:42
  • If you need to do something nonstandard then yes, but don't try to duplicate something that is already automatic. – Neil Aug 16 '18 at 06:29
  • Possible duplicate of [jwt token expiration time (asp.net core)](https://stackoverflow.com/questions/51334572/jwt-token-expiration-time-asp-net-core) –  Aug 16 '18 at 07:33
  • in asp.net core i am planning delegatinghandler more simplier approach than others which is authenticationhandler which is for me i find it difficult to implement. I will paste my code here to show my progress. I need someone who implemented this already. – Yabetsu2018 Aug 16 '18 at 11:45
  • @intentionallyleftblank : thank you for the link but i saw this already and had a hard time how to formulate my question into code as well. – Yabetsu2018 Aug 17 '18 at 01:31

0 Answers0