我应该在哪里把用户名/密码在Rails应用程序HTTP基本身份验证 [英] Where should I put username/password for http basic authentication in rails app

查看:119
本文介绍了我应该在哪里把用户名/密码在Rails应用程序HTTP基本身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要使用HTTP的基本身份验证在Rails应用程序。我看着这个railscast弄清楚怎么办做到这一点:

I am going to use http-basic-authentication in a rails app. I watched this railscast to figure out how do do that:

http://railscasts.com/episodes/82-http-basic-authentication

在视频中,他说不要直接把用户名和密码在code。我应该在哪里他们那么投入?

In the video he says not to put the username and password directly in the code. Where should I put them then?

我使用的铁轨3.1.0。

I am using rails 3.1.0.

推荐答案

您想将其移动到配置文件。 Ceck出关于应用程序配置这一RailsCast

You want to move them into config files. Ceck out this RailsCast about "Application Configuration".

这篇关于我应该在哪里把用户名/密码在Rails应用程序HTTP基本身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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