Skip to content
This repository has been archived by the owner on Jul 31, 2024. It is now read-only.

During the cleanup token process, add support for an event when token is expired. #2359

Closed
gsvitak opened this issue Jun 5, 2018 · 18 comments
Assignees
Milestone

Comments

@gsvitak
Copy link

gsvitak commented Jun 5, 2018

Hello

I have a third party system that uses the concept of sessions to maintain user state. I need the ability to automatically clean up the sessions in the third party system when the tokens are expired. I would love to have an event that is fired by the token cleanup process so I can implement my logic to clean up the sessions.

I would be willing to help with the work for this feature request if needed.

Thanks,
G

@brockallen
Copy link
Member

brockallen commented Jun 5, 2018

Not a bad idea.

The main problem/trick I foresee is how would in the event would it call into your code? I don't think we'd be able to use the DI system, because the way the loop is running (outside an HTTP request).

@brockallen brockallen added this to the 2.3 milestone Jun 5, 2018
@brockallen
Copy link
Member

@LindaLawton this might be a nice project given that you mentioned your Friday plans :)

@LindaLawton
Copy link
Contributor

Sounds like fun considering i have not played in the event system yet. Assign me to it. I know where to find you if i have any questions free to point me in the correct direction. The last bug took me four hours to find and five minutes to fix :)

@gsvitak
Copy link
Author

gsvitak commented Jun 5, 2018

Awesome!! thanks. Let me know if can help.

@gsvitak
Copy link
Author

gsvitak commented Jun 12, 2018

@LindaLawton Thanks for the support. I am curious to see how things are going. Any updates?

Thanks,
G

@LindaLawton
Copy link
Contributor

I didn't have long to look at it but was unavailable to figure out what even calls it. its like the setting isn't used anywhere.

I should have some more time to look at it Friday.

@gsvitak
Copy link
Author

gsvitak commented Jul 14, 2018

@LindaLawton checking in.. how are things going?

@LindaLawton
Copy link
Contributor

unfortunately we had some issues at work that have priority, and now we are into vacation season. I won't have to look at this until the end of August.

@brockallen
Copy link
Member

How would this event look like? Just a delegate? Or something from DI? DI is tricky since this token thing runs outside of http requests.

@gsvitak
Copy link
Author

gsvitak commented Aug 3, 2018

A delegate is fine. Understand the DI complexity.

@brockallen
Copy link
Member

Ok so turns out i was already resolving stuff from DI in the token cleanup, so we can do a service in DI

@brockallen
Copy link
Member

ok, done -- and with an interface in DI.

@gsvitak
Copy link
Author

gsvitak commented Aug 4, 2018

Thank you!! Do you have a unit test to show how it works?

@brockallen
Copy link
Member

no, but the sample EF host does. if you'd like to add tests, we'd love them

@jjavierdguezas
Copy link

Hi, please can you show some piece of code?
I need to do some stuff when a token is expired, but I cant figure it out
thanks in advance

@jjavierdguezas
Copy link

@gsvitak @brockallen, can you please help me find the piece of code that do this feature? thanks in advance

@jjavierdguezas
Copy link

for future references you should implement IOperationalStoreNotification

@lock
Copy link

lock bot commented Jan 11, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants