I am implementing a REST API with Spring Boot and I am securing it with JWT and Oauth 2.
I have no problems with authentication and producing an access token.
Now, I want to perform an action after the user gets authenticated and another different action when the access token is expired and/or user logs out.
How can I trigger a method after login and logout/access token expiry in Spring Boot?
Any help would be appreciated.