kratos icon indicating copy to clipboard operation
kratos copied to clipboard

after logout webhook

Open karitham opened this issue 2 years ago • 3 comments

Preflight checklist

Describe your problem

I use browser flows for the front end (SPA).

I am caching the Ory Session Cookies on my backend because hitting ory cloud each time is too expensive.

To revoke this cache, I need to know when a user logs out.

Describe your ideal solution

An after logout webhook (exactly like login except it's a logout), containing enough data to identify the logged-out session (containing the now-revoked token for example).

Workarounds or alternatives

Hitting my backend to revoke the cache, as well as make a request to ory to delete the session.

Unfortunately, it seems the cookie session tokens are not session tokens as described by the API, thus we cannot revoke them by using API flows.

Another alternative would be to emulate a browser flow, but that becomes ridiculous really fast.

Version

Cloud

Additional Context

Other session providers such as Auth0 explicitly use this method to make their clouds offering usable.

Without proper callbacks, using browser flows is essentially impossible, and using API flows is just more complex.

karitham avatar Sep 30 '22 16:09 karitham

That’s a great idea! Contributions as always welcomed :)

aeneasr avatar Oct 03 '22 08:10 aeneasr

This would be very useful for example for disabling push notifications for users that have logged out. Any traction for the implementation?

trautonen avatar Apr 14 '24 15:04 trautonen

@trautonen Yes, there is. I am pretty interested in contributing to this one.

getlarge avatar May 11 '24 18:05 getlarge