c# - SMS 2FA 如何在 .NET Core 3.0 中实现
问题描述
是否可以在 .net core 3 应用程序中使用 SMS 实现 2FA?
是的,我已经看过这个页面https://docs.microsoft.com/en-us/aspnet/core/security/authentication/2fa?view=aspnetcore-1.1&viewFallbackFrom=aspnetcore-3.0但接口 ISmsSender 不再存在.NET Core 3.0 Identity 也不是 .NET Core 2.0 。
所以我看不出这仍然可以实现吗?
为任何建议干杯
解决方案
您真的不需要库,大多数 SMS 网关都支持简单的 REST 调用。像 Microsoft.AspNet.WebApi.Client 这样的库应该就足够了 - POST 应该包含类似
curl -X "POST" "https://rest.nexmo.com/sms/json" \ -d "from=AcmeInc" \ -d "text=A text message sent using the Nexmo SMS
API" \ -d "to=$TO_NUMBER" \ -d "api_key=$NEXMO_API_KEY" \ -d "api_secret=$NEXMO_API_SECRET"
nexmo 也有一个 .Net 库https://developer.nexmo.com/messaging/sms/overview#sms-api-features
推荐阅读
- hyperledger-fabric - 超级账本结构背书政策
- node.js - 如何在 Cloud Firestore 中对数组执行逻辑 AND 复合查询?
- spring-batch - Spring Batch - 在处理器跳过时禁用 ItemReader 缓存,并再次处理过滤的行
- hyperledger-fabric - Hyperledger Fabric 2.0 -chaincode 作为外部服务:未知链码类型:EXTERNAL
- python - Selenium python 将 YouTube 视频向前滑动 10 秒
- azure - 如何使用 msal4j 使用令牌进行身份验证?
- java - 如何在 glassfish / payara REST 服务器中注册 jackson-datatype-joda
- c# - 如何在 Application Insights 中为 Web 作业设置警报并在 Web 作业失败时获取通知
- javascript - 在 Angular-JS 中,如何根据所选行中包含的数据显示按钮?
- jira - jira 宏以分层(史诗、故事、任务、子任务)方式表示 jira 报告