user447951
user447951

Reputation: 16961

Intermitent Yahoo Oauth2 invalid_redirect_uri

I am working on allowing users to log in to my website using Yahoo. I have intermittent problems with Yahoo Oauth2. I will generate the url to request the authorization code and it will get to the Yahoo login sometimes. Other times I will get the window with "Uh oh Looks like something went wrong. Please try again later. Developers: Please specify a valid request and submit again." and the url will have error=invalid_request&error_description=invalid+redirect+uri

My request url is configured on the yahoo console. Also I am using https on a server connected to the internet (not a local machine)

My request authorization was created using the one in https://developer.yahoo.com/sign-in-with-yahoo I have https://api.login.yahoo.com/oauth2/request_auth? client_id={MY CLIENT D} &scope=openid &nonce=4c29ac770b9b1d795b &prompt=consent &response_type=code &redirect_uri=https%3A%2F%2F{MY WEB SITE}%2Fcallback_yahoo.php

I am out of ideas at this point. Thank you

Upvotes: 1

Views: 679

Answers (3)

Ali Helmut Baltschun
Ali Helmut Baltschun

Reputation: 11

To implement Yahoo OAuth correctly, make sure you're using the OAuth2 Authorization Code Flow rather than the "Sign in with Yahoo" guide, which follows a different flow.

When creating your app, ensure you select Confidential Client as the client type. This option is necessary to support secure and server-side token handling, which is ideal for scenarios where you need to keep the client secret secure on the server.

Upvotes: 0

Nae
Nae

Reputation: 15335

I think the yahoo api for updating redirect uris is pretty abysmal as it is eventually consistent. It's as if there are multiple replicas eventually updated but it is pretty slow. For example I'm right now still waiting for more than a day update.

Upvotes: 0

user447951
user447951

Reputation: 16961

Apparently (maybe) something was wrong on Yahoos side. I created another application with the SAME configuration and the problem seem to have gone away.

Upvotes: 0

Related Questions