如何在Rails 4中从头开始创建身份验证 [英] How to create authentication from scratch in rails 4

查看:92
本文介绍了如何在Rails 4中从头开始创建身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Rails 4中创建一个记事应用程序,我真的不想使用devise或任何其他用户身份验证系统,因为我真的很想自己编写代码.我发现的唯一问题是,那里没有任何好的教程.我发现的教程不会教您如何真正进行用户身份验证,因为您只是始终保持在所谓的主页上.所以我想知道是否有人从头开始有任何关于用户身份验证方法的想法或示例?

I am trying to make a note application in rails 4 and I really do not want to use devise or any any other user authentication system because I would really just like to code it my self. The only problem I have found is that there aren't any good tutorials out there. The tutorials that I have found do not teach you how to really do user authentication because you just stay on the so called home page the whole time. So I was wondering if anybody had any ideas or examples of user authentication methods from scratch?

非常感谢.

推荐答案

不要这样做.

您不知道会意外导致严重妥协的多种方式.

You have no idea of the number of ways that you can accidentally leave yourself open to serious compromise.

您不像从事设计工作多年的数百名开发人员那样聪明(我们都不是).

You are not as smart as the hundreds of developers that have been working for years on devise (none of us are).

请参阅 Rails安全指南,其中提供了人们可以使用的方法的简短列表使用您可能从未考虑过的应用程序.

Have a look at the Rails Security Guide for a short list of the ways that people can use your app that you probably never even considered.

如果您想玩转游戏并看看它是如何完成的,那么请确保播放...但是当您真正保护真正的应用程序时...只需使用Devise.

If you want to play around and have a go to see how it's done, then sure play... but when you come to actually securing a real app... Just Use Devise.

这篇关于如何在Rails 4中从头开始创建身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆