0
votes

I'm using the Facebook Actionscript API v1.8.1 and currently having an OAUthException Error after trying to call FacebookMobile.login:

var stageWebView:StageWebView = new StageWebView();
stageWebView.stage = this.stage;
stageWebView.viewPort = new Rectangle(0, 0, stage.stageWidth, stage.stageHeight);
FacebookMobile.login(onFacebookLogin, stage, ["publish_stream"], stageWebView);

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

So far my AS3 web version is working fine using the same Facebook App ID.

I would appreciate any help and guidance.

1
Your redirect URL needs to match your Canvas URL. See stackoverflow.com/a/27902300/3932026 - phasma
Thank you @Jacob for the guidance, I actually went back to this post to share my discovered solution but I saw your comment and it's the same solution that I've implemented. - romeo

1 Answers

0
votes

I've used the default redirect URL of Facebook https://www.facebook.com/connect/login_success.html, but unfortunately the Facebook API that I'm using is somehow using an invalid default URL that doesn't match in Facebook App -> Advanced -> Valid OAuth redirect URIs that I've set, so I've added a quick fix:

FacebookMobile.login(onFacebookLogin, stage, ["read_stream"], facebookWebView);

var url:String = facebookWebView.location;
url = url.replace("http%3A%2F%2Fwww%2Efacebook%2Ecom%2Fconnect%2Flogin%5Fsuccess%2Ehtml", "https://www.facebook.com/connect/login_success.html");
facebookWebView.loadURL(url);

Hope this would help others too.