Skip to content

feat(auth): enchanted link delivery options, PKCE and full session fields - #443

Closed
yosiharan wants to merge 2 commits into
mainfrom
sdk-update/v1-auth-enchantedlink-20261119-213809
Closed

yosiharan wants to merge 2 commits into
mainfrom
sdk-update/v1-auth-enchantedlink-20261119-213809

Conversation

@yosiharan

Copy link
Copy Markdown
Contributor

Related Issues

Required for:
https://github.com/descope/etc/issues/19999

Description

The enchanted link API now covers every request and response field of the enchanted link endpoints: provider and template selection, SSO app sign-in, recovery, PKCE, and conflict handling on updates.

Shared code:

  • LoginOptions, SignUpOptions, UpdateOptions, User and the shared request classes gain fields; they default to null and are omitted, so magic link, OTP, password and mgmt request bodies are unchanged.
  • AuthenticationsBase.getAuthenticationInfo copies the new JWTResponse fields (cookie settings, claims, external token, device JWTs, etc.) into AuthenticationInfo for every auth method; existing fields are unchanged.
  • AssociatedTenant.permissions and roleIds are deserialize-only, since the class is also sent in mgmt user create/patch requests.

Backwards compatibility:

  • Existing EnchantedLinkService methods are kept and delegate to the new overloads with null options; signUpOrIn with no options sends the same body as before.
  • Previous all-args constructors of the models that gained fields are kept explicitly (japicmp: no binary incompatibility).

Interface and enum additions: EnchantedLinkService gains signIn/signInWithPhone/signUpOrIn/signUpOrInWithPhone overloads taking EnchantedLinkSignInOptions (the signUpOrIn ones also take a token and LoginOptions), signUp/signUpWithPhone overloads taking EnchantedLinkSignUpOptions, and verify(token, byte[] pkceVerifier). No new enum values.

Also: UserResponse.getTOTP/getSAML/getOAuth were never populated because Jackson bound them to lowercase names; they now read TOTP/SAML/OAuth (lowercase is still accepted), which affects every UserResponse, including mgmt user loads.

In a Nutshell

  • POST /v1/auth/enchantedlink/signin/email -> EnchantedLinkService.signIn (providerId, templateId, ssoAppId, useRecovery; LoginOptions gains ssoAppId, pkceChallenge, tenantId)
  • POST /v1/auth/enchantedlink/signin/sms -> EnchantedLinkService.signInWithPhone (same as above)
  • POST /v1/auth/enchantedlink/signup-in/email -> EnchantedLinkService.signUpOrIn (token, LoginOptions, and the sign-in options above)
  • POST /v1/auth/enchantedlink/signup-in/sms -> EnchantedLinkService.signUpOrInWithPhone (same as above)
  • POST /v1/auth/enchantedlink/signup/email -> EnchantedLinkService.signUp (providerId, templateId; SignUpOptions gains locale, pkceChallenge, templateId, tenantId; User gains loginId, recoveryEmail, recoveryPhone)
  • POST /v1/auth/enchantedlink/signup/sms -> EnchantedLinkService.signUpWithPhone (same as above)
  • POST /v1/auth/enchantedlink/update/email -> EnchantedLinkService.updateUserEmail (UpdateOptions gains providerId, templateId, locale, failOnConflict)
  • POST /v1/auth/enchantedlink/update/phone/sms -> EnchantedLinkService.updateUserPhone (same as above)
  • POST /v1/auth/enchantedlink/verify -> EnchantedLinkService.verify (pkceVerifier)
  • POST /v1/auth/enchantedlink/pending-session -> EnchantedLinkService.getSession (AuthenticationInfo and UserResponse gain the remaining response fields, including UserFamily, SCIM and OIDC flags)

Must

  • Tests
  • Documentation (if applicable)

Generated by Descope SDK Agent 🤖🌟

@shuni-bot

shuni-bot Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

🐕 Shuni Review

No new issues found.

Approval outcome: APPROVED
Reason: Full review completed with no findings and clear review threads.

🤖 Model: claude-opus-5.5 · Effort: medium


Review scope: Full review

Reviewed files (22)
  • README.md
  • src/main/java/com/descope/model/auth/AssociatedTenant.java
  • src/main/java/com/descope/model/auth/AuthenticationInfo.java
  • src/main/java/com/descope/model/auth/IDPResponse.java
  • src/main/java/com/descope/model/auth/UpdateOptions.java
  • src/main/java/com/descope/model/enchantedlink/EnchantedLinkSignInOptions.java
  • src/main/java/com/descope/model/enchantedlink/EnchantedLinkSignUpOptions.java
  • src/main/java/com/descope/model/jwt/response/JWTResponse.java
  • src/main/java/com/descope/model/magiclink/LoginOptions.java
  • src/main/java/com/descope/model/magiclink/SignUpOptions.java
  • src/main/java/com/descope/model/magiclink/request/SignInRequest.java
  • src/main/java/com/descope/model/magiclink/request/SignUpRequest.java
  • src/main/java/com/descope/model/magiclink/request/UpdateEmailRequest.java
  • src/main/java/com/descope/model/magiclink/request/UpdatePhoneRequest.java
  • src/main/java/com/descope/model/magiclink/request/VerifyRequest.java
  • src/main/java/com/descope/model/user/User.java
  • src/main/java/com/descope/model/user/response/UserFamily.java
  • src/main/java/com/descope/model/user/response/UserResponse.java
  • src/main/java/com/descope/sdk/auth/EnchantedLinkService.java
  • src/main/java/com/descope/sdk/auth/impl/AuthenticationsBase.java
  • src/main/java/com/descope/sdk/auth/impl/EnchantedLinkServiceImpl.java
  • src/test/java/com/descope/sdk/auth/impl/EnchantedLinkServiceImplTest.java

🐕 Review complete — View session on Shuni Portal 🐾

🤖 Model: claude-opus-5.5 · Effort: medium

shuni-bot[bot]
shuni-bot Bot previously approved these changes Nov 19, 2026

@shuni-bot shuni-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🐕 Shuni review: no new findings. Every changed file in this pull request was reviewed.

The full review summary is in Shuni's sticky review comment on this pull request.

@shuni-bot shuni-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🐕 Shuni review: no new findings. Every changed file in this pull request was reviewed.

The full review summary is in Shuni's sticky review comment on this pull request.

@yosiharan

Copy link
Copy Markdown
Contributor Author

[DESCOPE-SDK-AGENT 🤖] Closing: this run is superseded by a fresh SDK agent run with an updated harness.

@yosiharan yosiharan closed this Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant