问题
Similar questions and answers have not solved my problem.
I have two Facebook apps. One is a test version for the other so they are nearly identical. I am having no problems on test. But on the live app I am getting "redirect_uri is not owned by the application" errors.
A case in point this apprequest.
FB.ui(
{ method: 'apprequests',
message: 'Greetings! Would you be my neighbor?',
data: 'invite_friends'
},
function (response) {
});
I even manually added redirect_uri in this next snippet.
FB.ui(
{ method: 'apprequests',
message: 'Greetings! Would you be my neighbor?',
data: 'invite_friends',
redirect_uri: location.protocol + '//' + location.host + location.pathname
},
function (response) {
});
Either way I get the "redirect_uri is not owned by the application" error with the code on my live app and not my testing app.
In both apps the settings follow this pattern.
- App Domains: subdomain.domain.com , domain.com
- Site URL: http ://subdomain.domain.com/
- Canvas URL: http ://subdomain.domain.com/Facebook/
- Secure Canvas URL : https ://subdomain.domain.com/Facebook/
- Page Tab URL: http ://subdomain.domain.com/Facebook/
- Secure Page Tab URL: https ://subdomain.domain.com/Facebook/
We are using the FB JS SDK. That being the case the redirect_uri should be supplied by the SDK and from what I can see it uses location.protocol + '//' + location.host + location.pathname
.
So, if the redirect_uri is supplied by the SDK and my settings are correct why would it work in one app and not the other?
Please help this has wasted over a day of my time already. I'm sure it is something stupid but I can't find it for the life of me.
回答1:
Determined that the problem stemmed from an improperly set AppID within our app code. This presumably was causing the app to be recognized as another app our company produces and therefore the mismatch in redirect_uri.
来源:https://stackoverflow.com/questions/13594310/redirect-uri-is-not-owned-by-the-application