-
Notifications
You must be signed in to change notification settings - Fork 6k
Oauth2 maximumSessions did not work #15194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @DucNguyenVan, thanks for getting in touch, but it seems possible that your issue is related to your custom callback handler and is not a bug in the framework. It feels like this is a question that would be better suited to Stack Overflow. We prefer to use GitHub issues only for bugs and enhancements. Feel free to update this issue with a link to the re-posted question (so that other people can find it) or add a minimal sample that reproduces this issue if you feel this is a genuine bug. Having said that, the sample you have provided is not complete so I'm unsure where the issue lies. Please provide the following:
Can you please explain what is meant by "custom provider"? Do you mean that it does not implement the OAuth 2.0 or OpenID Connect 1.0 specs?
It is not clear why you need to do this, and possibly part of the issue. If the provider implements the spec(s) correctly, this should not be necessary. Can you please explain why this is necessary?
You appear to be duplicating some of the functionality provided by the If you believe you've found a bug, please remove your custom callback in favor of using the built-in redirection endpoint documented here and here and provide a complete, minimal sample. I will leave this issue open for now but will close it if you are unable to provide an update. Related gh-15071 |
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed. |
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue. |
Describe the bug
I am implementing OAuth2 to connect with a custom provider (not Google or GitHub). I need implement a custom callback handler in a controller for handling the OAuth2 login flow in Spring Security. Everything worked well, and the user was logged in successfully.
Now I need to implement a mechanism that logs out the current user session when the same user logs in from another device.
I tried to set maximumSessions(1) in the sessionManagement section, but it did not work.
I also tried to implement a custom success handler successHandler, but the success handler was not triggered (it seems like because I implemented a custom callback handler, it did not trigger the success handler event).
To Reproduce
Steps to reproduce the behavior.
Expected behavior
log out the current user session when the same user logs in from another device
Sample
The text was updated successfully, but these errors were encountered: