简体   繁体   English

使用 Twilio 进行 OTP 验证 - 如何在验证后保持用户登录

[英]OTP Verification with Twilio - how to keep user logged in after verification

Using Twilio Verify API to authenticate the user via SMS.使用Twilio Verify API通过短信验证用户。
I do not want the user to keep doing the OTP process every time he opens the app - I want to keep him authenticated once he completed the OTP for the first time.我不希望用户每次打开应用程序时都继续执行 OTP 过程 - 我想在他第一次完成 OTP 后让他通过身份验证。
How do I do that - should I generate a token somehow after he logged in?我该怎么做——我应该在他登录后以某种方式生成令牌吗?

Appreciate any help.感谢任何帮助。

Once you have authenticated the user you will want to store something that you can check to see whether they have authenticated.一旦您对用户进行了身份验证,您将希望存储一些您可以检查以查看他们是否已通过身份验证的内容。 Normally this would be a token of some sort that can be used to access any remote services, but it doesn't have to be.通常这将是某种可用于访问任何远程服务的令牌,但并非必须如此。

The answer marked as correct on this question is a good explanation of how to do this, but it should also be noted that storing a token in unencrypted storage is a potential security issue, so you should also pay attention to the highest voted answer with the links to secure storage libraries.这个问题上标记为正确的答案很好地解释了如何做到这一点,但还应该注意,将令牌存储在未加密的存储中是一个潜在的安全问题,因此您还应该注意投票最高的答案链接到安全存储库。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM