26

I'm getting the following error when trying to authenticate to Facebook with OAuth:

{
   "error": {
      "message": "Invalid redirect_uri: Given URL is not allowed by the Application configuration.",
      "type": "OAuthException"
   }
}

My url looks like this:

https://graph.facebook.com/oauth/authorize?client_id=283993944973616&redirect_uri=http://dennys-m.appspot.com/fb_login/&scope=publish_stream,email&display=popup

I know there are a lot of other posts with this problem, but I can't see what would make my url invalid. Any ideas why I'm getting this error?

5 Answers 5

30

Your redirect url: http://dennys-m.appspot.com/fb_login/ must match the canvas url in https://developers.facebook.com/apps/ configuration panel.

Fortunately, these days Facebook gives the error message Invalid redirect_uri: Given URL is not allowed by the Application configuration. About a year ago no such exception appeared, just strange results.

0
12

In my case there was no / at the end of mine redirect uri! No comments to fb..

0
11

You have to register your redirect URL at Facebook console

First go to Advanced tab inside Settings

enter image description here

There after scroll down to Valid OAuth redirect URIs

register your url there the moment you will save changes it will stop giving this exception

enter image description here

1
  • that's what i was going to answer but u did it before
    – Partha Roy
    Commented Feb 29, 2016 at 5:44
1

if you are using localhost:3000 as your call back url, For example your call back uri may like: http://localhost:3000/sessions/create, where sessions/create are the controller and action respectively, then make your Canvas URL as: http://localhost:3000/

1

Something else: It might sound stupid but read those snippets carefully. Facebook doc snippet

It took me several days to figure out why I always got this error message

Invalid redirect_uri URI is not supported

Those curley brackets are not a part of the URI!

Again, it might sound stupid and some of you out there might say "This would never happen to me" but if you are new into something use your brain ( I didn't ;) )

1
  • same thing bro)
    – Big Coach
    Commented Aug 23, 2018 at 13:51

Not the answer you're looking for? Browse other questions tagged or ask your own question.