Diego81 / omnicontacts

A generalized Rack middleware for importing contacts from major email providers.
477 stars 231 forks source link

Yahoo OAuth connection error #186

Open martinhladil opened 5 years ago

martinhladil commented 5 years ago

It seems that Yahoo dropped OAuth 1 support and the attempt to call OAuth 1 simply fails with the connection error. I was trying to modify the code to support OAuth 2, but I was only able to get myself to the consent screen 5ece3d70c399b23c25e44aa8ae6a8a12352c7a0d, the following process is out of my league unfortunately.

louie728 commented 4 years ago

I am facing this same exact issue the connection error that I am seeing in my rails log states .. `Error internal_error while processing /contacts/yahoo:

Error 405 HTTP method POST is not supported by this URL

HTTP ERROR 405

Problem accessing /oauth/v2/get_request_token. Reason:

    HTTP method POST is not supported by this URL


Powered by Jetty:// 9.4.z-SNAPSHOT

`

Has anyone resolved integration with Yahoo?

DemitryT commented 4 years ago

@louie728 With the help of @martinhladil gist, I was able to update a custom fork of this gem to get the Yahoo importer to work with OAuth 2. You can see the changes here: https://github.com/jr180180/omnicontacts/pull/1#pullrequestreview-338831829

Essentially I just updated the Yahoo importer to use the OAuth 2 logic. Also, updated the methods for the new flow and now storing the Yahoo user GUID in a session variable to be able to use it in the importer. I'm sure this can be done in a cleaner way, but did the trick for me.

I should also mention that I had to create a new Yahoo app on my developer account to get this working.

Lastly, in the Rails app that's using the above fork, I had to update config/initializers/omnicontacts.rb for yahoo (notice I'm now using redirect_path instead of callback_path):

importer :yahoo, ENV['YAHOO_CLIENT_ID'], ENV['YAHOO_CLIENT_SECRET'], redirect_path: '/contacts/yahoo/contact_callback'

Hope this helps!

louie728 commented 4 years ago

@DemitryT and @martinhladil Thanks! I ended up using omniauth-yahoo_auth with some custom code. I do appreciate the response though.

Thanks