Skip to content

feat(auth): add magic link provider, template and recovery options - #446

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

yosiharan wants to merge 2 commits into
mainfrom
sdk-update/v1-auth-magiclink-20261119-232143

Conversation

@yosiharan

Copy link
Copy Markdown
Contributor

Related Issues

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

Description

Magic link sign-in, sign-up, sign-up-or-in and update calls can now pass the provider, template, SSO app, tenant, locale and recovery options the API accepts, and verify returns the full session response.

Client-side validation:

  • signUp with MagicLinkSignUpOptions.phone and DeliveryMethod.EMAIL throws an invalid-argument error before sending.

Shared code:

  • LoginOptions (+ssoAppId, pkceChallenge, tenantId) and SignUpOptions (+locale, pkceChallenge, templateId, tenantId) are also used by OTP, enchanted link, password, TOTP, WebAuthn, OAuth/SAML/SSO and mgmt embedded/test links; the new fields are omitted unless set.
  • UpdateOptions gains providerId, templateId, locale, failOnConflict: only the magic link update methods send them, OTP and enchanted link ignore them. AssociatedTenant +permissions/roleIds are write-only so mgmt user create/patch never sends them.
  • AuthenticationsBase.getAuthenticationInfo (every verify/exchange/refresh) copies the new JWTResponse fields onto AuthenticationInfo; existing getters are unchanged.

Backwards compatibility:

  • All previous constructors of LoginOptions, SignUpOptions, UpdateOptions, User, JWTResponse, AuthenticationInfo and the request models are kept; japicmp reports no binary incompatibility.
  • Existing MagicLinkService overloads delegate with null and send the same body as before.

Interface and enum additions:

  • MagicLinkService: new overloads signIn(..., LoginOptions, MagicLinkSignInOptions), signUpOrIn(deliveryMethod, loginId, uri, LoginOptions, MagicLinkSignInOptions), signUp(..., SignUpOptions, MagicLinkSignUpOptions).
  • New models MagicLinkSignInOptions, MagicLinkSignUpOptions, UserFamily.

Also: UserResponse (all mgmt user responses too) now maps TOTP/SAML/OAuth via @JsonProperty; they were always null before and now serialize under those names, a visible change for callers who re-serialize UserResponse.

In a Nutshell

  • POST /v1/auth/magiclink/signin/{email,sms,whatsapp} -> MagicLinkService.signIn (gains providerId, templateId, ssoAppId, useRecovery; loginOptions gains ssoAppId, pkceChallenge, tenantId)
  • POST /v1/auth/magiclink/signup-in/{email,sms,whatsapp} -> MagicLinkService.signUpOrIn (gains loginOptions, providerId, templateId, ssoAppId, useRecovery)
  • POST /v1/auth/magiclink/signup/{email,sms,whatsapp} -> MagicLinkService.signUp (gains phone, providerId, templateId; loginOptions gains locale, pkceChallenge, templateId, tenantId; user gains loginId, recoveryEmail, recoveryPhone)
  • POST /v1/auth/magiclink/update/email -> MagicLinkService.updateUserEmail (gains providerId, templateId, locale, failOnConflict)
  • POST /v1/auth/magiclink/update/phone/{sms,whatsapp} -> MagicLinkService.updateUserPhone (gains providerId, templateId, locale, failOnConflict)
  • POST /v1/auth/magiclink/verify -> MagicLinkService.verify (AuthenticationInfo gains the cookie, session expiration, claims, SSO and device JWT response fields; UserResponse gains the spec's user fields)

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: Cumulative full review completed across trusted review history with no findings and clear review threads.

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


Review scope: Partial incremental re-review

Reviewed new changes (3)
  • src/main/java/com/descope/sdk/auth/MagicLinkService.java
  • src/main/java/com/descope/sdk/auth/impl/MagicLinkServiceImpl.java
  • src/test/java/com/descope/sdk/auth/impl/MagicLinkServiceImplTest.java
Previously reviewed and unchanged: 18 files.

🐕 Review complete — View session on Shuni Portal 🐾

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

@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: 1 inline finding. 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