0

I am using omnicontacts gem for retrieving mail contacts. I am able to use it for gmail but for yahoo I always get an error :-

"Custom port is not allowed or the host is not registered with this consumer key".

I am not specifying any custom port in my callback url. Also I have verified the domain in yahoo app but still getting the same error. Help please. I went through this link as well

OmniContacts gem always fail on with my yahoo contacts importes

My callback url is

http://www.domain-name/callback

where domain-name is my domain name.

and my routes file is as follows

Rails.application.routes.draw do

    match "/contacts/:importer/callback" => "main#index", :via => [:get]
    match "/oauth2callback" => "main#contact", :via => [:get]
    match "/callback" => "main#contact", :via => [:get]
    root 'main#index'

end

My controller code is as follows :-

class MainController < ApplicationController

    def index
    end

    def contact
      @contacts = request.env['omnicontacts.contacts']
      respond_to do |format|
        format.html 
      end
    end

end
Community
  • 1
  • 1
Anirudh Rautela
  • 113
  • 1
  • 17
  • Have you registered `http://www.domain-name/` as host at yahoo ?, Its clearly saying `host is not registered with this consumer key` – Pramod Shinde Apr 27 '15 at 10:43
  • Is your callback correctly defined, I see `match "/contacts/:importer/callback" => "main#index", :via => [:get]`, but you are reading contacts in `main#contact`, Why not write `"/contacts/:importer/callback" => "main#contact", :via => [:get]` – Pramod Shinde Apr 27 '15 at 10:45
  • I did not get an option of specifying a host at yahoo when I registered the app .. These are the options I got when I registered the app.. Application Name, Application TypeWeb Application, Description(Optional), Home Page URL(Optional), Callback Domain(Optional), API Permissions – Anirudh Rautela Apr 27 '15 at 11:01
  • I am also using the correct Client id and client secret. – Anirudh Rautela Apr 27 '15 at 11:08
  • Have you added Home Page URL(Optional), Callback Domain(Optional) though its optional?, and make sure your reading client_id and secret from correct environment if you are using different keys for different environments, I have used this gem before I did get any error – Pramod Shinde Apr 27 '15 at 11:10
  • I have added the optional parameters as well. But I need to ask one thing. Currently I am testing this app on test server so technically it does not have a domain name.. Can this be a possibility ? I cannot test it directly on live. So if that is the case then I will need to either check the app on heroku. – Anirudh Rautela Apr 27 '15 at 11:29
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/76356/discussion-between-pramod-shinde-and-anirudh-rautela). – Pramod Shinde Apr 27 '15 at 11:31