Skip to content

Add OAuth2 Jackson runtime hints - #19603

Open
goutamadwant wants to merge 1 commit into
spring-projects:mainfrom
goutamadwant:gh-18145
Open

Add OAuth2 Jackson runtime hints#19603
goutamadwant wants to merge 1 commit into
spring-projects:mainfrom
goutamadwant:gh-18145

Conversation

@goutamadwant

Copy link
Copy Markdown

Summary

Register the Jackson runtime hints needed when OAuth2 login or client state is stored in a session in a native image.

The hints cover:

  • reflective construction of Spring Security's Core, Web, WebFlux, servlet, and OAuth2 Client Jackson modules
  • binding metadata for their mixins and custom deserializers
  • OAuth2 client, authentication, saved-request, reactive CSRF, and factor authority types stored in sessions
  • both Jackson 2 and Jackson 3, while preserving optional classpath boundaries

This follows the working reproducer from the issue and includes the reactive WebServerJackson2Module and DefaultCsrfServerTokenMixin path confirmed by the reporter.

JDK serialization hints remain tracked by spring-projects/spring-session#3103 and its active PR #3411; this change does not duplicate that work. Spring Security PR #19593 separately adds Java-serialization metadata for FactorGrantedAuthority; this change adds only the Jackson binding categories needed because OAuth2 login stores that authority in the authenticated session.

Testing

  • ./gradlew :spring-security-core:test :spring-security-web:test :spring-security-oauth2-client:test --continue
  • ./gradlew check
  • focused runtime-hint tests rerun with --rerun-tasks --no-build-cache

Closes gh-18145

Closes spring-projectsgh-18145

Signed-off-by: goutamadwant <workwithgoutam@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: waiting-for-triage An issue we've not yet triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consider adding runtime hints to support oauth2Login() and oauth2Client()

2 participants