Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues authenticating with remote devise #200

Open
mylanconnolly opened this issue Feb 25, 2014 · 2 comments
Open

Issues authenticating with remote devise #200

mylanconnolly opened this issue Feb 25, 2014 · 2 comments

Comments

@mylanconnolly
Copy link

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!

@mitfik
Copy link
Contributor

mitfik commented Mar 1, 2014

Did you tried to setup extra_attributes in config file for that authenticator?

@mylanconnolly
Copy link
Author

For right now, I have moved on to another project since I wanted to
continue ahead, but I will certainly look into it when I get back around
to it, thank you for the tip!

On 03/01/2014 04:46 PM, Robert Mitwicki wrote:

Did you tried to setup extra_attributes in config file for that
authenticator?


Reply to this email directly or view it on GitHub
#200 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants