简体   繁体   中英

Facebook Client OAuth settings domain not working with query strings

I'm trying to get the Auth working with Facebook but it keeps on telling me that my redirect URL is not working.

In the Valid OAuth Redirect URIs I have the following

 https://localhost

The issue is that, I'm passing some additional query string to my callback, like

 https://localhost?uuid=something&service=my_service

When attempting to Auth, I do get the request popup and then I get a redirect URL but then Facebook is telling me that the URL is not allowed.

脸书错误

If I test https://localhost?uuid=something&service=my_service in Facebook's Redirect URI Validator it's telling me it's not valid

How can I add aa URL including a dynamic query string? I've tried

 https://localhost*

But Facebook is telling me this is not a valid URL and won't let me save/add this URL.

@ceejayoz put me on the right track, I will answer my own question, that might help someone else.

Additional data must be passed in a state parameter such as

 $data = json_encode($some_std_class);
 $pdata = $fb_helper->getPersistentDataHandler();
 $pdata->set('state', $data);
 $login_url = $fb_helper->getLoginUrl($my_url, $my_permissions);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM