datacite / omniauth-orcid

ORCID Strategy for OmniAuth
MIT License
9 stars 9 forks source link

Authentication error when using the sandbox api #3

Closed anusharanganathan closed 8 years ago

anusharanganathan commented 8 years ago

When the OAuth callback is received from Orcid sandbox, I get the following error

ERROR -- omniauth: (orcid) Authentication failure! invalid_credentials:
OAuth2::Error, :
{"message-version":"1.2","orcid-profile":null,"orcid-search-results":null,
"error-desc":{"value":"Not found : No entity found for query"}}

I do have a user profile in both production and sandbox Orcid instances, but I guess my user id would be different in both.

Antonin Delpeuch very kindly pointed out that the profile details were being fetched from production and not sandbox. See message [https://groups.google.com/d/msg/orcid-api-users/tWjaJpjtvRQ/VCQjogUzDAAJ for details]()

mfenner commented 8 years ago

Yes, this is a bug. I tried to abstract away the different options to call the ORCID API (member, sandbox), but didn't fully think this true for the second API call that fetches additional information - a feature added recently. For now the workaround is to use skip_info? => true in the omniauth configuration options.

anusharanganathan commented 8 years ago

Thanks. Good to know about the option. I got it working by just fixing the url in the api call. The PR has the code changes I needed to make. I haven't updated the rspec, but happy to do so with a little guidance. I had a look and wasn't sure if it needed updating.

mfenner commented 8 years ago

Merged the pull request, released as 1.0.31. There are a few other minor changes I want to make before releasing 1.1, which should then have documentation of the changes since 1.0.