feat: implement otp sms session challenge (#11919)

# Which Problems Are Solved

This PR adds the OTP SMS Challenge needed for CreateSession API
https://github.com/zitadel/zitadel/issues/11035

# How the Problems Are Solved

- Introduce `OTPSMSChallengeCommand` (validate/execute/events) for
session creation checks
- Introduce `GetOTPCryptoGeneratorConfigWithDefault` to fetch
per-instance secret generator settings
- Add unit tests

# Additional Changes

Refactor tests in `session_check_recovery_code_test.go` to make the
helper functions reusable in `session_challenge_otp_sms_test.go`

# Additional Context
Related to https://github.com/zitadel/zitadel/issues/11035
This commit is contained in:
Gayathri Vijayan
2026-03-26 11:33:44 +00:00
committed by GitHub
parent f94e4065c2
commit f99142bc4a
12 changed files with 2008 additions and 71 deletions
+2
View File
@@ -210,6 +210,8 @@ func startZitadel(ctx context.Context, config *Config, masterKey string, server
new_domain.SetLegacyEventstore(eventstoreClient)
new_domain.SetSystemConfig(config.SystemDefaults)
new_domain.SetIDPEncryptionAlgorithm(keys.IDPConfig)
new_domain.SetMFAEncryptionAlgorithm(keys.OTP)
new_domain.SetOTPSMSSecretGeneratorConfig(config.DefaultInstance.SecretGenerators.OTPSMS)
sessionTokenVerifier := internal_authz.SessionTokenVerifier(keys.OIDC)
sessionTokenDecryptor := internal_authz.SessionTokenDecryptor(keys.OIDC)