-
We are using FusionAuth refresh tokens as our session. Users can connect from multiple devices. We want to record the duration (plus other metadata) of each session for reporting purposes.
How can we do so?
-
The easiest way to do so is to listen for the
jwt.refresh-token.revokeevent.It's documented here: https://fusionauth.io/docs/v1/tech/events-webhooks/events/jwt-refresh-token-revoke
In particular, you have the date of the revocation (the end of the session). If it is an individual session revocation, you have the start date, which is the
startInstantinside the eventsrefreshTokenfield.If your webhook processor does the subtraction of these two values, you'll be able to find and record the duration of the session length.
-
D dan moved this topic from Q&A on
-
D dan moved this topic from Frequently Asked Questions (FAQ) on
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login