Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

AspNetZero as backend for Ionic 2 mobile application #2191


User avatar
0
vnetonline created

Dear Halil

I am planning to use aspnetzero as the backend for my ionic 2 mobile application and was wondering how long does the token last (i.e. Number of minutes in which it expires which) I get from /api/account/authenticate ... also is there a function to refresh if it is about to expire ??


1 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Currently it is 30 minutes but you can set it like this if your version of AspNet Zero does not have it already.

    var currentUtc = new SystemClock().UtcNow;
    ticket.Properties.IssuedUtc = currentUtc;
    ticket.Properties.ExpiresUtc = currentUtc.Add(TimeSpan.FromMinutes(30));
    

    There is no function to refresh it right now. You can request a new token using /api/account/authenticate when you get a 401 error.