-
Notifications
You must be signed in to change notification settings - Fork 20
Customize your sms pin scope validator
Yugang Zhou edited this page Aug 23, 2022
·
1 revision
You may have multiple scenario that needs SMS PIN, hence, for security reasons, you need to diff SMS PIN even for the same phone number, consider some one who submit SMS PIN for login for change password verification.
Daming
provides a concept called SVS
, the User Agent must provides 'SVS' when requesting for SMS PIN and verifying SMSP PIN
To protect daming
from invalid User Agent,com.thebund1st.daming.core.SmsVerificationScopePattern
provides an abstraction for validating SMS PIN scope.
By default, daming
provides a by default implementation of 6 digits for SmsVerificationScopePattern
, you can configure it by setting:
# application-{profile}.properties
# 可使用','分隔多个SVS
daming.sms.verification.scope.valid=SMS_LOGIN, VERY_IMPORTANT_OPERATION, ANOTHER
Wiring any SmsVerificationScopePattern
implementation into Spring ApplicationContext
@Component
public class MySmsVerificationScopePattern implements SmsVerificationScopePattern {
@Override
public boolean matches(SmsVerificationScope value) {...}
}
- 快速入门
- 文档
- 为什么要开发Daming
- 集成模式
- 安装Daming
- Sms Verification Scope
- 集成短信供应商
- 什么是Sms Verification JWT
- API
- 非生产环境支持
- 防止验证码暴力破解
- 验证码发送限流
- 设置验证码有效期
- 微服务模式的SDK (TBD)
- 已知问题
- 示例
- 变更历史(TBD)