feat: support federated OIDC login through the OAuth2 Authorization Server (#24050) - #24351
Merged
Conversation
|
david-mackessy
approved these changes
Jul 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Backport of #24050 to 2.43.
JIRA:DHIS2-21752
What
Fixes federated OIDC login through DHIS2's OAuth2 Authorization Server. After an external-IdP login ("Log in with Google"), reading the authorization at
/oauth2/tokenreturned HTTP 500, because the persisted principal (DhisOidcUserwrapping aUserDetailsImpl) is not on Spring Security'sSecurityJackson2Modulesdeserialization allowlist.The persistence layer now swaps the heavyweight DHIS2 principal for a lean, Spring-native
UsernamePasswordAuthenticationToken(DHIS2 username + authorities) at thetoEntityserialization boundary, so the persisted attributes round-trip with no custom Jackson mixins. This also fixes the federated flow end to end — theusername/emailclaims previously carried the IdPsub.Backport notes
cd398b5); no code conflicts.UserDetailsImpl.javaresult is byte-identical to master's post-PR version.Principalattribute, so the lean-principal approach is valid.mvn test-compileofdhis-service-core,dhis-test-integration,dhis-test-web-api→ BUILD SUCCESS; all three backported tests compile (LeanPrincipalTest,Dhis2OAuth2AuthorizationServiceIntegrationTest,FederatedOidcTokenControllerTest).Original PR: #24050
AI Assisted