0

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.

2
  • 1
    Your redirect URL needs to match your Canvas URL. See stackoverflow.com/a/27902300/3932026 Feb 12, 2015 at 1:24
  • 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
    Feb 13, 2015 at 3:48

1 Answer 1

0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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