Skip to content

feat(auth): add OTP IM delivery and missing OTP request options - #448

Closed
yosiharan wants to merge 2 commits into
mainfrom
sdk-update/v1-auth-otp-20261120-005227
Closed

yosiharan wants to merge 2 commits into
mainfrom
sdk-update/v1-auth-otp-20261120-005227

Conversation

@yosiharan

Copy link
Copy Markdown
Contributor

Related Issues

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

Description

The OTP service can now send codes over IM and pass the provider, template, SSO app, recovery and tenant options the OTP API accepts.

Shared code:

  • AuthenticationsBase.verifyDeliveryMethod/getMaskedValue treat IM like the phone methods; magic link sign-in/up and generateOtpForTestUser/generateMagicLinkForTestUser reject IM before sending, since those APIs have no IM route.
  • LoginOptions, SignUpOptions, User and UpdateOptions gain optional fields that stay null and are omitted, so existing requests are unchanged; the UpdateOptions additions are sent by OTP updates only.
  • UserResponse, AssociatedTenant, IDPResponse, JWTResponse and AuthenticationInfo gain response fields; UserResponse now also reads TOTP/SAML/OAuth as spelled by the API (it previously read only the lower-case names), and AssociatedTenant.permissions/roleIds are read-only so tenants passed back to the user and access key APIs send what they did before.

Backwards compatibility:

  • Existing OTPService overloads delegate to the new ones with null and send the same requests.
  • Every model whose Lombok all-args constructor grew keeps its previous all-args constructor (japicmp against the base: no changes).

Interface and enum additions:

  • OTPService.signIn(..., OTPSignInOptions), signUp(..., OTPSignUpOptions) and signUpOrIn(deliveryMethod, loginId, LoginOptions, OTPSignInOptions).
  • DeliveryMethod.IM ("im"), OTP only.
  • New models OTPSignInOptions (providerId, templateId, ssoAppId, useRecovery), OTPSignUpOptions (providerId, templateId) and UserFamily.

In a Nutshell

  • POST /v1/auth/otp/signin/im -> OTPService.signIn(DeliveryMethod.IM, ...)
  • POST /v1/auth/otp/signup-in/im -> OTPService.signUpOrIn(DeliveryMethod.IM, ...)
  • POST /v1/auth/otp/signup/im -> OTPService.signUp(DeliveryMethod.IM, ...)
  • POST /v1/auth/otp/update/phone/im -> OTPService.updateUserPhone(DeliveryMethod.IM, ...)
  • POST /v1/auth/otp/verify/im -> OTPService.verifyCode(DeliveryMethod.IM, ...)
  • POST /v1/auth/otp/signin/{email,sms,voice,whatsapp} -> OTPService.signIn: providerId, templateId, ssoAppId, useRecovery, loginOptions.ssoAppId/pkceChallenge/tenantId
  • POST /v1/auth/otp/signup-in/{email,sms,voice,whatsapp} -> OTPService.signUpOrIn: loginOptions, providerId, templateId, ssoAppId, useRecovery
  • POST /v1/auth/otp/signup/{email,sms,voice} -> OTPService.signUp: providerId, templateId, user.loginId/recoveryEmail/recoveryPhone, loginOptions.locale/pkceChallenge/templateId/tenantId
  • POST /v1/auth/otp/update/email, POST /v1/auth/otp/update/phone/{sms,voice,whatsapp} -> OTPService.updateUserEmail/updateUserPhone: providerId, templateId, locale, failOnConflict, mfa
  • POST /v1/auth/otp/verify/{email,sms,voice,whatsapp} -> OTPService.verifyCode: new AuthenticationInfo response fields (cookie settings, sessionExpiration, externalToken, claims, trustedDeviceJwt, and more)

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 (7)
  • src/main/java/com/descope/model/auth/AuthenticationInfo.java
  • src/main/java/com/descope/model/user/response/UserResponse.java
  • src/main/java/com/descope/sdk/auth/OTPService.java
  • src/main/java/com/descope/sdk/auth/impl/AuthenticationsBase.java
  • src/main/java/com/descope/sdk/auth/impl/OTPServiceImpl.java
  • src/main/java/com/descope/sdk/mgmt/impl/JwtServiceImpl.java
  • src/test/java/com/descope/sdk/auth/impl/OTPServiceImplTest.java
Previously reviewed and unchanged: 20 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: 2 inline 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