Question

I'm trying to implement my first Facebook application, and I'm stuck on the very first coding step.

I created an application on the Facebook website, I got my application ID and I'm doing an ASP.NET app to test the authentication. It has just one line:

Response.Redirect(
"https://www.facebook.com/dialog/oauth?client_id=MYAPPID&redirect_uri=localhost");

When I run it, it redirects to facebook and I get:

An error occurred with MYAPPNAME. Please try again later.

It fetches the app name, so the ID is correct and there is very little else that I could have got wrong :-)

I also tried using other URLs instead of localhost, and I'm currently arranging for a VPS to try it with a publicly deployed web app in case it doesn't work with a local one.

Searching only found me lots of posts complaining about similar issues - but not the same one. I found this question that looks quite similar, but the confirmed answer speaks about editing FB.init() which is I guess part of some SDK, so not applicable for me.

Was it helpful?

Solution

Your redirect uri must be a url that is within the domain that you configured in your application set up. As noted in the documentation.

"The redirect_uri must be within the same domain as the Site URL you specify in Web site tab of the Developer App"

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top