Search code examples
authenticationoauth-2.0identityserver4openid-connectrefresh-token

Does IdentityServer4 have a mechanism to alert a user their refresh token is about to expire?


Currently my solution has refresh tokens with sliding timeout of 1 hour, and an absolute timeout of 6 hours.

My requirement (which I was given, for the record I don't like this!) is that I must alert the user that their session is about to expire and that they must interact with the system if they want to continue.

Does IdentityServer4 have a mechanism for handling this?

If not, is there a preferred approach to implementing this functionality?


Solution

  • No, there is no built in function for this, its up to the clients to ask for new tokens when they are about to expire.

    The easiest solution is to use the IdentityModel.AspNetCore NuGet package and you can read the documentation here