-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
SID and SessionInformation is null in IdToken when AuthorizationService or Userdetails uses Jdbc or Jpa. #1361
Comments
I had face a similar issue, try commenting out |
Here's the related SO question (https://stackoverflow.com/questions/77093539/sid-missing-in-id-token-using-spring-authorization-server) where I asked for this issue to be opened. |
@gurneeraj I'm currently unable to reproduce your issue. There are no users in the database when the application starts up. Further, it looks like you cloned the |
Hi, For testing, I created a simple project:
More can be found in the README Please let me know when something does not work. BR, |
@nucle sorry you're having trouble. I looked at your sample, and it is also not minimal. If starting from one of our existing samples, please only make the minimal changes necessary to add a postgres database (adding liquibase also is fine) for the authorization service. There are a number of other changes in your sample, including adding cors, disabling csrf, adding a custom authentication provider, storing the user details in the database, and possibly other changes. Those changes should not be required to reproduce this issue. Please remove them, and I can take another look. |
@sjohnr np I will create a minimal example. |
@ramonmalcolm10, I had the same issue and I fixed it by doing as you did - deleting OAuth2AuthorizationService which is configured in the code from samples |
Hi instead of using userdetailsservice. I used my own custom authorization provider, it solved the issue. |
While trying to logout from Spring Authorization Server when spring cloud gateway (Oauth2client) calls logout endpoint, I found SID is null because AuthorizationService or Userdetails uses Jdbc or Jpa.
I used UserDetailsService for creating a UserDetails object.
While debugging I found SessionRegistryImpl is returning null SessionInformation. Highlighted line returns null because 'principal(UserDetails)' is different from ones' present in 'principals'.
I created a sample which is similar to the issue I am facing right now. When you run the sample, SID will be null but when you comment out JdbcAuthorizationService config SID will be present in IDToken.
https://github.com/gurneeraj/auth-test
The text was updated successfully, but these errors were encountered: