You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug removeAuthorizationRequest method of HttpSessionOAuth2AuthorizationRequestRepository always return null which cause OAuth2AuthenticationException when using it with GenericJackson2JsonRedisSerializer
To Reproduce
Configure project included below dependencies
plugins {
id 'java'
id 'org.springframework.boot' version '2.7.8'
id 'io.spring.dependency-management' version '1.0.15.RELEASE'
}
sourceCompatibility ='11'
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-oauth2-client'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-data-redis'
implementation('org.springframework.session:spring-session-data-redis') {
exclude group: 'org.springframework.data', module: 'spring-data-redis'
}
}
Configure redis to use Generic2Jackson2JsonRedisSerializer so that session value can be stored as json format
Try to authenticate through oauth2 protocol
Expected behavior
It should be return appropriate request value no matter what format we use.
Sample
Look around this Sample and don't forget to configure oauth2 properties with yours
The text was updated successfully, but these errors were encountered:
@ilyako87 Unfortunately i couldn't solve this problem.
I had to use the default serializer. If you encounter similar issue with mine then i guess it didn't fixed yet.
Let me know if you solve your problem i also want to know how to solve this one as well.
I came across a similar issue today but it's nothing to do with serializer. I was debugging the application on a remote server with https disable. However the cookie was configured to be secure, thus not sent to the server, then it kept creating new sessions.
Thanks for reaching out @Y-k-Y! Apologies that this issue was not responded to for a long time.
Thank you for providing a sample. It appears that you are not configuring the ObjectMapper for Redis per the documentation. I believe it would look like this (which works when I change your sample). I don't think you need the RedisTemplate@Bean in your sample to make Spring Session work.
Describe the bug
removeAuthorizationRequest
method ofHttpSessionOAuth2AuthorizationRequestRepository
always return null which causeOAuth2AuthenticationException
when using it withGenericJackson2JsonRedisSerializer
To Reproduce
Generic2Jackson2JsonRedisSerializer
so that session value can be stored as json formatExpected behavior
It should be return appropriate request value no matter what format we use.
Sample
Look around this Sample and don't forget to configure oauth2 properties with yours
The text was updated successfully, but these errors were encountered: