3

I am using strongloop to make mobile APIs. In Stongloop accessToken expires after 14 days.

So the scenario is like below:

Day 1

  1. User login & get AccessToken
  2. Using this accessToken request for Other APIs(like get all users list)

Day 15 (accessToken is expired)

  1. Using accessToken got on Day 1 request for API - get all users list

On day 15 it will respond with access deny.. because access token is expired..

I want to make such API that if user open App On Day 1 & then Day 15. it should be logged In automatically. with new accessToken.

In short: I want to make such mechanism that if accessToken is expired It should re-generate accessToken & provide in response.

Other suggestion to make workflow like mine?

Vishant dhandha
  • 495
  • 7
  • 19
  • HI, the usual approach is to implement a refresh token with longer expiration time and use this token to get a new one, other possibility would be to just make the token valid for longer time if it's ok for your business case. Check this - http://stackoverflow.com/questions/26739167/jwt-json-web-token-automatic-prolongation-of-expiration – groo Jun 01 '16 at 11:47
  • You can use /api/AccessTokens/create method. Use sample payload as following { "ttl": 1209600, "created": "01-09-2016", "userId": "57c7b04f8a424c9023dfdd" } – prasad katankot Sep 01 '16 at 12:23
  • Did you find an answer to this ? – Shivansh Jagga Oct 03 '19 at 08:20

0 Answers0