简体   繁体   English

Rails API的用户身份验证

[英]User Authentication for Rails API

so a question which has been confusing me. 这个问题一直困扰着我。 I have created a simple API server using ruby on rails and able to read the data through my android program i created. 我已经使用ruby on rails创建了一个简单的API服务器,并能够通过我创建的android程序读取数据。 SO I wanted to create a user register/login , however then it struck me i would probably need a token authentication so that not everyone can come and delete my entire database right ? 所以我想创建一个用户注册/登录,但是这让我很震惊,我可能需要令牌认证,以便不是每个人都可以来删除我的整个数据库,对吗? However, now im confused , do i need to have 2 authentication before using the API then ? 但是,现在我很困惑,那么在使用API​​之前我需要进行2次身份验证吗? One for social media such as facebook, twitter , g+ , and one for the API itself ? 一种用于社交媒体,例如facebook,twitter,g +,另一种用于API本身? I know it sounds silly, why would i need two authentication? 我知道这听起来很愚蠢,为什么我需要两次身份验证? But i thought i best ask look around first for my answer. 但是我想我最好先问一下周围的人。 Also since i heard facebook authentications token usually expire every 90 days.. does that mean i have to relogin the user every 90 days ? 另外,由于我听说facebook身份验证令牌通常每90天过期一次。.这是否意味着我必须每90天重新登录一次用户? Would be good if someone can point me to the right direction 如果有人可以指出我正确的方向,那会很好

Have you hear about Firebase? 您听说过Firebase吗? They have quite a lot of examples on how to handle authentication with their services. 他们有很多关于如何使用服务处理身份验证的示例。 They can handle your backend easily for you. 他们可以为您轻松处理您的后端。

Best thing about Firebase is that it is free for low usage apps and the pricing is quite reasonable for a small team. Firebase最好的一点是,它对于低使用率的应用程序是免费的,而且对于小型团队来说,价格是相当合理的。

Here are some useful links. 这里是一些有用的链接。

https://firebase.google.com/docs/auth/ https://firebase.google.com/docs/auth/

https://firebase.google.com/products/ https://firebase.google.com/products/

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

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