-
Notifications
You must be signed in to change notification settings - Fork 268
Description
Hello, I saw that support was recently added for doing remote devise authenticators. I was ecstatic to see that it was accepted, so I tried it out.
Currently, my infrastructure is laid out as follows:
I have an app at http://localhost:4000 set up as a rubycas_client. When users go to any URL, it does the rubycas thing. Redirects work perfect. Its URL is https://localhost:443.
Where I run into problems is in the response back from Devise (or maybe the handling of the response?). My remote Devise seems to be working fine, as shown by some sample logging output:
Started POST "/users/sign_in.json" for 127.0.0.1 at 2014-02-25 16:59:14 -0500
Processing by Devise::SessionsController#create as JSON
Parameters: {"user"=>{"email"=>"[email protected]", "password"=>"[FILTERED]"}, "session"=>{"user"=>{"email"=>"[email protected]", "password"=>"[FILTERED]"}}}
MOPED: 127.0.0.1:27017 COMMAND database=admin command={:ismaster=>1} runtime: 40.4029ms
MOPED: 127.0.0.1:27017 QUERY database=user_management_development collection=users selector={"$query"=>{"email"=>"[email protected]"}, "$orderby"=>{:_id=>1}} flags=[] limit=-1 skip=0 batch_size=nil fields=nil runtime: 1.0539ms
MOPED: 127.0.0.1:27017 UPDATE database=user_management_development collection=users selector={"_id"=>BSON::ObjectId('530ceb1b7562754033000000')} update={"$set"=>{"last_sign_in_at"=>2014-02-25 21:53:13 UTC, "current_sign_in_at"=>2014-02-25 21:59:14 UTC, "sign_in_count"=>16, "updated_at"=>2014-02-25 21:59:14 UTC}} flags=[]
COMMAND database=user_management_development command={:getlasterror=>1, :w=>1} runtime: 1.2601ms
[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message.
Completed 201 Created in 180ms (Views: 2.4ms)
However, I get the following error on the rubycas server end:
NoMethodError at /login
undefined method `has_key?' for nil:NilClass
file: remote_devise.rb
location: block in validate
line: 105
It references this block of code (starting at line 102):
@extra_attributes = json[@options[:devise][:model].to_s]
if @extra_attributes.has_key?('username')
@extra_attributes['username_devise'] = @extra_attributes['username']
@extra_attributes.delete('username')
end
If someone could point me in the right direction I'd greatly appreciate it.
Thanks!