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
{{ message }}
Repository navigation
Logging in via oauth2 using redis session throws jackson error #3510
Describe the bug
When I attempt to login via oauth 2 using redis sessions I get this jackson error
org.springframework.data.redis.serializer.SerializationException: Could not read JSON:Could not resolve type id 'java.net.URL' as a subtype of `java.lang.Object`: Configured `PolymorphicTypeValidator` (of type `tools.jackson.databind.jsontype.BasicPolymorphicTypeValidator`) denied resolution
at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); byte offset: #1988] (through reference chain: org.springframework.security.core.context.SecurityContextImpl["authentication"]->org.springframework.security.oauth2.client.authentication.OAuth2AuthenticationToken["principal"]->org.springframework.security.oauth2.core.oidc.user.DefaultOidcUser["authorities"]->java.util.HashSet[0]->org.springframework.security.oauth2.core.oidc.user.OidcUserAuthority["idToken"]->org.springframework.security.oauth2.core.oidc.OidcIdToken["claims"]->java.util.LinkedHashMap["iss"])
the error location of the json in redis appears to be here
I created a new bug in spring security which is where I now think this bug belongs. If their team confirms I will close this one in favor of the new one
Activity
bilak commentedon Mar 3, 2026
I'm facing the same issue currently. Were you able to fix/workaround it?
I have config like this:
bilak commentedon Mar 3, 2026
Hmm and quickly found a solution adding
BasicPolymorphicTypeValidatorczp3009 commentedon Apr 8, 2026
I've encountered the same problem, it seems that the URL type was omitted after Spring Session was migrated to Jackson 3.
The URL was present in the AllowlistTypeIdResolver of Jackson 2 in older versions, but was lost during the migration to Jackson 3.
The URL type is used in the
issfield of the OIDC token, so it's currently broken.A more precise and secure method for adding URL types:
ievgen-kapinos commentedon Apr 11, 2026
@bilak Thank you man 🙏
msosa commentedon Apr 15, 2026
I created a new bug in spring security which is where I now think this bug belongs. If their team confirms I will close this one in favor of the new one