设计无法检测:omniauthable,但它就在那里(Devise can't detect :omniauthable, but it's there)
我有一个RoR应用程序,运行Devise Gem进行身份验证。 对于我的新API,我实现了Gem“devise-token-auth”: https : //github.com/lynndylanhurley/devise_token_auth
由于我希望Devise运行网站和API身份验证,我也遵循以下说明中的额外提示(以及Gem's Git的常见问题解答): http : //www.developingandrails.com/2015/02/api -authentication与- devisetokenauth.html
我已停用Devise's:确认,但已激活:omniauthable。 一切似乎都已到位,但我收到以下错误:
/Users/sebastianplasschaert/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/devise-3.5.2/lib/devise/rails/routes.rb:240:in `block in devise_for': Mapping omniauth_callbacks on a resource that is not omniauthable (ArgumentError) Please add `devise :omniauthable` to the `User` model
在我的用户模型中,我从以下代码开始:
class User < ActiveRecord::Base # Include default devise modules. Others available are: # :confirmable, :lockable, :timeoutable and :omniauthable devise :invitable, :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable, :omniauthable include DeviseTokenAuth::Concerns::User
所以,:omniauthable似乎在那里。 当我停用时:
include DeviseTokenAuth::Concerns::User
然后一切都有效(但我需要它用于我的API身份验证)。
关于我做错的任何想法?
I have a RoR application, running the Devise Gem for authentification. For my new API I've implemented the Gem "devise-token-auth": https://github.com/lynndylanhurley/devise_token_auth
Since I want Devise to run for the website and API authentication, I followed the extra tips in the following instruction as well (and als the FAQ of the Gem's Git): http://www.developingandrails.com/2015/02/api-authentication-with-devisetokenauth.html
I've deactivated Devise's :confirmable, but activated :omniauthable. Everything seems to be in place, but I'm getting the following error:
/Users/sebastianplasschaert/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/devise-3.5.2/lib/devise/rails/routes.rb:240:in `block in devise_for': Mapping omniauth_callbacks on a resource that is not omniauthable (ArgumentError) Please add `devise :omniauthable` to the `User` model
And in my User model I start with the following code:
class User < ActiveRecord::Base # Include default devise modules. Others available are: # :confirmable, :lockable, :timeoutable and :omniauthable devise :invitable, :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable, :omniauthable include DeviseTokenAuth::Concerns::User
So, :omniauthable seems to be there. When I deactivate:
include DeviseTokenAuth::Concerns::User
then everything works again (but I need it for my API authentication).
Any ideas on what I'm doing wrong?
原文:https://stackoverflow.com/questions/36228764
最满意答案
据我所知,您需要为您尝试写入的文件夹提供IUSR_MACHINENAME帐户的写权限,否则它将失败。 我不知道Coda是什么,但是它可以让你为特定用户设置权限吗?
As far as I know, you need to give the IUSR_MACHINENAME account write permissions specifically on the folder that you are trying to write to, or else it will fail. I don't know what Coda is, but can it allow you to set permissions for specific users?
相关问答
更多-
你几乎就在那里,我想你想要: Server.MapPath("~/clinicalclient/Rosefiles/" + DropDownList1.Text); You're almost there, I think you want: Server.MapPath("~/clinicalclient/Rosefiles/" + DropDownList1.Text);
-
Urlscan在所有网站上都有效,并且具有自己的请求实体长度限制。 我并不知道Urlscan正在我们的服务器上运行,因为它是一个全球性的ISAPI筛选器,并未在我的个人网站上运行。 注意:要找到全局ISAPI筛选器,请右键单击IIS Admin中的Web Sites文件夹,然后单击“属性”,然后在“ISAPI筛选器”选项卡上。 Urlscan was active on all websites, and has it's own request entity length limit. I wasn't ...
-
虽然我从cPanel更改了PHP设置,但每当我使用ini_get()它都给了我在cPanel中设置的不起作用。 我解决了它(如果你可以访问php.ini文件),通过改变php.ini文件本身而不是cPanel的设置。 Although I changed the PHP settings from the cPanel, and whenever I used ini_get() it gave me the settings that I had in the cPanel it didn't work. ...
-
您需要检查上传目录的权限。 有关更多信息,请访问以下URL http://social.technet.microsoft.com/Forums/windows/en-US/fe6fc533-8688-4faf-848c-ba98cd6d6ec0/iis7-php-permissions-issue you need to check the permissions on the uploading directory. For more information chekc the following UR ...
-
问题是文件夹无法访问。 感谢Darin Dimitrov的帮助 the problem is the folder is not accessible. Thanks for Darin Dimitrov for his helps
-
哦,男孩......我真的觉得很蠢。 这是临时文件夹上的权限问题。 我确实将IIS服务帐户添加到临时文件夹的安全设置,但我忘了添加权限。 = P Oh boy...I really feel stupid. It was a permissions issue on the temp folder. I did add the IIS service account to the temp folder's security settings, but I forgot to add permissions ...
-
您需要将additionalUploadFileExtensions属性添加到Web.config中的ajaxControlToolkit部分:
请参考这篇文章: https : //github.com/DevExpress/AjaxControlToolkit/wiki/AjaxFileUpload-setup You need to add the additionalUp ... -
什么是IIS6.0中的最大文件上传大小?(What is max file upload size in IIS6.0? and how do we overcome that?)[2024-02-19]
我可能会使用FTP方法。 使用FTPWebRequest - 试用Google的示例代码。 I'd probably go with a FTP approach. Using FTPWebRequest - try Google for sample code. -
无法在IIS上上传文件(Can't Upload File on IIS)[2022-09-09]
据我所知,您需要为您尝试写入的文件夹提供IUSR_MACHINENAME帐户的写权限,否则它将失败。 我不知道Coda是什么,但是它可以让你为特定用户设置权限吗? As far as I know, you need to give the IUSR_MACHINENAME account write permissions specifically on the folder that you are trying to write to, or else it will fail. I don't kn ... -
PHP Curl上传图片,在IIS 7上,图片未完全上传(PHP Curl upload image, on IIS 7, image not completely uploaded)[2022-06-17]
得到它了 ! 所以这是一个文件夹权限问题。 由于某些未知原因,文件上传在服务实现之前工作正常....... 所以我编辑了默认的上传文件夹,即C:\ Windows \ Temp,我添加了对iis_iusrs的完全控制权限。 谢谢 Got it ! so it was a folder permission problem. for some unknown reasons, file upload was working just fine before the service implementation ...