Skip to content

feat: add IDPResponse to AuthenticationInfo for SSO exchange#321

Merged
dorsha merged 3 commits intomainfrom
feat/expose-idp-response-to-sdk
Apr 21, 2026
Merged

feat: add IDPResponse to AuthenticationInfo for SSO exchange#321
dorsha merged 3 commits intomainfrom
feat/expose-idp-response-to-sdk

Conversation

@dorsha
Copy link
Copy Markdown
Member

@dorsha dorsha commented Apr 21, 2026

Summary

  • Add IDPResponse type with idpGroups, idpSAMLAttributes, and idpOIDCClaims fields
  • Add idpResponse field to AuthenticationInfo and JWTResponse
  • Wire through in getAuthenticationInfo() so SDK consumers can access IDP data after SSO token exchange

Related PRs

Test plan

  • Checkstyle passes
  • All unit tests pass
  • New tests: OAuthServiceImplTest.testExchangeTokenWithIDPResponse (OIDC claims)
  • New tests: SamlLinkServiceImplTest.testExchangeTokenWithIDPResponse (SAML attributes)

fixes: https://github.com/descope/etc/issues/15153

🤖 Generated with Claude Code

Add IDPResponse type with idpGroups, idpSAMLAttributes, and idpOIDCClaims
fields. Wire through from JWTResponse to AuthenticationInfo so SDK consumers
can access IDP data after SSO token exchange.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 21, 2026 07:45
@shuni-bot-dev
Copy link
Copy Markdown

shuni-bot-dev Bot commented Apr 21, 2026

🐕 Review complete — View session on Shuni Portal 🐾

@dorsha dorsha requested review from ruvenzx and slavikm April 21, 2026 07:45
@dorsha dorsha enabled auto-merge (squash) April 21, 2026 07:46
Copy link
Copy Markdown

@shuni-bot-dev shuni-bot-dev Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐕 Shuni's Review

Adds IDPResponse model (groups, SAML attributes, OIDC claims) and wires it through JWTResponseAuthenticationInfo so SDK consumers can access IDP data after SSO token exchange.

No issues found — good bones! Clean, minimal change that follows existing patterns. All AuthenticationInfo constructor call sites are updated, tests cover both OIDC and SAML scenarios. Woof!

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR exposes IdP-provided data (groups + SAML/OIDC attributes/claims) to Java SDK consumers after an SSO token exchange by adding a new IDPResponse model and threading it through JWTResponse -> AuthenticationInfo.

Changes:

  • Introduces IDPResponse with idpGroups, idpSAMLAttributes, and idpOIDCClaims.
  • Adds idpResponse to JWTResponse and AuthenticationInfo, and propagates it in getAuthenticationInfo() / JWT management flows.
  • Adds unit tests covering token exchange with IdP response data for both OAuth (OIDC claims) and SAML (SAML attributes).

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/main/java/com/descope/model/auth/IDPResponse.java Adds new model to hold IdP groups and attribute/claim maps.
src/main/java/com/descope/model/jwt/response/JWTResponse.java Adds idpResponse field to JWT exchange response DTO.
src/main/java/com/descope/model/auth/AuthenticationInfo.java Adds idpResponse field so SDK consumers can access IdP data.
src/main/java/com/descope/sdk/auth/impl/AuthenticationsBase.java Wires idpResponse from JWTResponse into returned AuthenticationInfo.
src/main/java/com/descope/sdk/mgmt/impl/JwtServiceImpl.java Wires idpResponse through mgmt JWT sign-in/up flow.
src/main/java/com/descope/sdk/auth/impl/AuthenticationServiceImpl.java Updates constructor call site to match new AuthenticationInfo signature.
src/test/java/com/descope/sdk/TestUtils.java Updates mock JWT response construction for new JWTResponse field.
src/test/java/com/descope/sdk/auth/impl/OAuthServiceImplTest.java Adds test validating OIDC claims/groups are exposed via AuthenticationInfo.idpResponse.
src/test/java/com/descope/sdk/auth/impl/SamlLinkServiceImplTest.java Adds test validating SAML attributes/groups are exposed via AuthenticationInfo.idpResponse.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/main/java/com/descope/model/auth/AuthenticationInfo.java
Comment thread src/main/java/com/descope/model/jwt/response/JWTResponse.java
Comment thread src/main/java/com/descope/model/auth/IDPResponse.java
dorsha and others added 2 commits April 21, 2026 10:53
Add explicit constructors with the previous parameter lists for
AuthenticationInfo and JWTResponse to preserve binary/source
compatibility for existing SDK consumers.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add testExchangeTokenWithoutIDPResponse tests for both OAuth and SAML
that use the old 8-arg JWTResponse constructor and verify idpResponse
is null, exercising the backwards-compatible constructor overloads.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@ruvenzx ruvenzx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dorsha dorsha merged commit 9716b64 into main Apr 21, 2026
17 checks passed
@dorsha dorsha deleted the feat/expose-idp-response-to-sdk branch April 21, 2026 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants