Skip to content

SID and SessionInformation is null in IdToken when AuthorizationService or Userdetails uses Jdbc or Jpa. #1361

Closed
@gurneeraj

Description

@gurneeraj

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'.
image

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

Metadata

Metadata

Assignees

Labels

for: stackoverflowA question that's better suited to stackoverflow.com

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions