I am using the omnicontacts gem so that users can invite their contacts on my website. I have set it up successfully for Google.
I have setup an omnicontacts controller with the contacts_callback method as suggested by the gem's readme.
and a route: get "/contacts/:importer/callback" => "omnicontacts#contacts_callback"
At the initializer of omnicontacts.rb I have the followings:
require "omnicontacts"
Rails.application.middleware.use OmniContacts::Builder do
importer :gmail, "hidden-client-key", "hidden-secret-key", {redirect_path: "/contacts/gmail/callback"}
importer :facebook, "hidden-client-key", "hidden-secret-key", {:redirect_path => "/contacts/facebook/callback" }
importer :hotmail, "hidden-client-key", "hidden-secret-key", {redirect_path: "/contacts/hotmail/callback"}
end
The last two (facebook and hotmail) according to the gem's readme file do not need a redirect_path but just in case I tested both with it or not and I still get an error that the redirect_uri is invalid. As I was searching for a solution I found a place that the :redirect_path was instead :callback_path and tried that as well but no luck.
On the Microsoft app (for hotmail) I was getting a longer description on the error which was:
The provided value for the input parameter 'redirect_uri' is not valid. The expected value is 'https://login.live.com/oauth20_desktop.srf' or a URL which matches the redirect URI registered for this client application.
As a result I went on and registered a redirect URI for this client application. The URI was http://example.com/contacts/hotmail/callback which matches the callback path.
Still, getting the same error. Any clue?