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

OpenID authentication fails to deal with multiple OpenIDs for same email #101

Open
hlapp opened this issue Dec 11, 2013 · 0 comments
Open

Comments

@hlapp
Copy link
Member

hlapp commented Dec 11, 2013

When logging in to traitdb-dev with one of my OpenIDs, I get the exception pasted below. This is likely because I probably already have an account, created earlier by logging in with Google.

The bug here is that I get the exception rather than a meaningful suggestion of what I should do instead. The desired enhancement is that the auth system is capable of handling multiple OpenIDs for the same email address. Associating additional OpenIDs to an email may be restricted to having to be logged in already. At the very least, it should be possible to change an associated OpenID to another one.

ActiveRecord::RecordNotUnique in Users::OmniauthCallbacksController#open_id
PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "users_pkey" : INSERT INTO "users" ("created_at", "email", "encrypted_password", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"

app/models/user.rb:17:in find_for_open_id' app/controllers/users/omniauth_callbacks_controller.rb:4:inopen_id'

Parameters:

{"openid.response_nonce"=>"2013-12-11T17:54:14ZcMXuEf",
 "openid.ns.sreg"=>"http://openid.net/extensions/sreg/1.1",
 "openid.signed"=>"assoc_handle,
ax.count.ext0,
ax.count.ext1,
ax.count.ext2,
ax.count.ext3,
ax.count.ext4,
ax.count.ext5,
ax.count.ext6,
ax.count.ext7,
ax.count.ext8,
ax.mode,
ax.type.ext0,
ax.type.ext1,
ax.type.ext2,
ax.type.ext3,
ax.type.ext4,
ax.type.ext5,
ax.type.ext6,
ax.type.ext7,
ax.type.ext8,
claimed_id,
identity,
mode,
ns,
ns.ax,
ns.sreg,
op_endpoint,
response_nonce,
return_to,
signed,
sreg.email,
sreg.fullname,
sreg.postcode",
 "openid.sreg.email"=>"[email protected]",
 "openid.op_endpoint"=>"http://www.myopenid.com/server",
 "openid.ax.type.ext8"=>"http://axschema.org/media/image/aspect11",
 "openid.ax.type.ext4"=>"http://axschema.org/namePerson/friendly",
 "openid.ax.type.ext5"=>"http://axschema.org/contact/city/home",
 "openid.identity"=>"http://username.myopenid.com/",
 "openid.ax.type.ext7"=>"http://axschema.org/contact/web/default",
 "openid.ax.type.ext0"=>"http://axschema.org/contact/email",
 "openid.ax.type.ext1"=>"http://axschema.org/namePerson",
 "openid.ax.type.ext2"=>"http://axschema.org/namePerson/first",
 "openid.ax.type.ext3"=>"http://axschema.org/namePerson/last",
 "openid.sig"=>"XXXXXX",
 "openid.return_to"=>"http://traitdb-dev.nescent.org/users/auth/open_id/callback?_method=post",
 "openid.ax.mode"=>"fetch_response",
 "openid.claimed_id"=>"http://username.myopenid.com/",
 "openid.ns.ax"=>"http://openid.net/srv/ax/1.0",
 "openid.mode"=>"id_res",
 "openid.ax.type.ext6"=>"http://axschema.org/contact/state/home",
 "openid.ax.count.ext0"=>"0",
 "openid.ax.count.ext1"=>"0",
 "openid.ax.count.ext2"=>"0",
 "openid.ax.count.ext3"=>"0",
 "openid.ax.count.ext4"=>"0",
 "openid.ax.count.ext5"=>"0",
 "openid.ax.count.ext6"=>"0",
 "openid.ns"=>"http://specs.openid.net/auth/2.0",
 "openid.ax.count.ext8"=>"0",
 "openid.ax.count.ext7"=>"0",
 "openid.sreg.fullname"=>"First Last",
 "openid.sreg.postcode"=>"12345",
 "openid.assoc_handle"=>"{HMAC-SHA1}{XXXXXX}"}
@dleehr dleehr added this to the Unscheduled milestone Mar 14, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants