codesw1tch
codesw1tch

Reputation: 720

Facebook Invalid Redirect URI

I'm trying to develop on my local machine. I've set the facebook Site URL to

http://localhost:8000

My Login Code:

function tryFBLogin() {
   FB.login(function(response) {
   if (response.authResponse) {
            console.log("User is connected to the application.");
            var accessToken = response.authResponse.accessToken;
            return  http.HttpResponseRedirect(reverse('http://localhost:8000/page/'))
        } else {
            console.log("Something messed up in facebook login");
        }
    });
}

When I click the login butt on I get this error message:

API Error Code: 191
API Error Description: The specified URL is not owned by the application
Error Message: Invalid redirect_uri: Given URL is not allowed by the Application configuration.

Upvotes: 2

Views: 1945

Answers (1)

Nix
Nix

Reputation: 58522

The redirect parameter has to match the domain for the app.

Set app domain blank, and the site url to the root of the link you are displaying.

App Domain: 
Site URL: http://localhost:8000

Upvotes: 1

Related Questions