17

I'm working on an app that uses Yahoo OAuth. The OAuth had been working fine but I just registered my domain with Yahoo and now it will not let me use the OAuth when I develop locally because "Custom port is not allowed or the host is not registered with this consumer key."

The issue is because my call back URL is to a domain that is not registered with Yahoo (http://localhost:8080/welcome).

I'm not sure what to do. I'm also new to development so if you could be specific with suggestions that would be awesome! Any help is greatly appreciated.

Andrew
  • 221
  • 2
  • 3
  • 6
  • I have the same problem, did you ever come up with a solution? Netflix and Google's OAuth work fine with localhost:8080 as the host for the callback. – Chad Oct 22 '10 at 02:07

6 Answers6

27

Hiii... yahoo works on localhost :).. what you have to do is while registering for a yahoo consumer key and secret key, the registration page asks you what type of application is yours. I guess it gives you two options , website and the oder one as stand alone app. Choose stand alone app as in your case. Then it will give you a pair of keys, and it will work on localhost :). Enjoy!

Vignesh Iyer
  • 300
  • 3
  • 6
  • Thanks for the tip! Totally worked! Not sure what we would have done if we couldn't test prior to deployment...especially given the wonderful state of their docs :P Thanks! – Joel May 27 '15 at 22:18
  • Feels great to see a comment for an answer that was helpful! Cheers! – Vignesh Iyer Jul 23 '15 at 16:29
  • Cool. Please accept this answer if you found this useful. – Vignesh Iyer Aug 20 '15 at 20:45
  • 3
    does not work when I create an app in YDN as installed app and then provide a callback_uri when requesting auth. it shows `uh oh seems like something went wrong` screen. any ideas what might be wrong? – Muhammad Adeel Zahid Jun 28 '16 at 21:52
8

It looks like Yahoo! doesn't want you to do this. Some answers from similar questions might be helpful (or not):

EDIT: more evidence Yahoo! doesn't support this: http://developer.yahoo.net/forum/?showtopic=6496&cookiecheckonly=1

Community
  • 1
  • 1
Chad
  • 2,064
  • 1
  • 22
  • 29
4

I found the simplest solution was just to register for a separate key for my development environment. As long as you don't verify the domain for that key, you shouldn't hit any issues.

dmccabe
  • 1,044
  • 12
  • 11
3

After many attempts, I too came to the conclusion that Yahoo's redirect_uri does not seem to work with ports other than 80.

The one solution that worked for me:

  1. Download ngrok
  2. Run the app and input ngrok http xxxx in the console - where xxxx is the port you are trying to access
  3. The command will generate a http://xxxxxx.ngrok.io forwarding link that can be used for Yahoo's needs
  4. Create a new Installed Application at https://developer.yahoo.com/apps/create/ and input http://xxxxxx.ngrok.io in the Callback Domain field.
  5. Links should now work with this redirect_uri
Stoyan Berov
  • 1,171
  • 12
  • 18
1

Addressing Muhammad's comment in Vignes's answer here because I can't comment. You should be able to use a callback with a stand alone app if you specify 127.0.0.1 as the callback domain. You may also needed to change the port that your local server is listening to, because you cannot request that yahoo use e.g. port 8000. Make sure your local server is listening to port 80.

Community
  • 1
  • 1
Malcolm White
  • 299
  • 2
  • 11
0

As of writing, setting the Application Type to Installed Application and then leaving the Callback Domain blank will give you errors.

What works is configuring 127.0.0.1 as the Callback Domain for the app. This works regardless if you are choosing Web Application or Installed Application as the Application Type. However, Yahoo! does not accept callback URLs with ports in it so you have to make sure your app listens to port 80 (or 443 if https) when running locally.

Another less ideal option would be using some random non-existent domain like local.dev.env.com as Callback Domain and then editing your hosts file by adding this:

127.0.0.1 local.dev.env.com

This will forward all requests on local.dev.env.com to 127.0.0.1.

galiarmero
  • 46
  • 1
  • 5