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

Token expiry #5253


User avatar
0
BobIngham created

dotnet-core, angular, 5.4.1 Hi all, Can anyone point me in the direction of documentation and/or code for token expiration dates? I use an Ionic app to log into Zero.

How long is the token valid for? How does sliding expiration work?

I know this is probably off-piste for Zero and more of a dotnet question but I have looked both in the code base and in the documentation and can find no detail of how to test both the expiration data and sliding expiration. Thanking you in advance....


2 Answer(s)
  • User Avatar
    0
    aaron created
    Support Team

    Can anyone point me in the direction of documentation and/or code for token expiration dates? How long is the token valid for?

    tokenAuthConfig.Expiration = TimeSpan.FromDays(1);
    

    AbpZeroTemplateWebCoreModule.cs#L98

    How does sliding expiration work?

    Sliding — as far as ASP.NET Zero and ABP are concerned — is only used for Caching, unrelated to tokens.

    SlidingExpiration is only available for cookies. In general, sliding expiration for accessToken is wrong. That's what a refresh token is for. More: #3921@bd978aed-945f-4b70-b020-0597adbae45a

  • User Avatar
    0
    BobIngham created

    Aaron, Perfect, thanks.