Facebook PHP SDK problem with getLoginUrl()
I am having 开发者_Python百科a trouble with PHP SDK logging in using getLoginUrl(). when the user click the link generated by that function it does not show the permission dialog instead it shows a facebook logo you must click it before showing the permission dialog please help me!
The Facebook logo is showing because your app is attempting to load the auth-dialog within the iframe, which is not allowed by OAuth 2.0. Instead your app must load the auth-dialog in the _parent or _top or in pop-out-window which is what happens when you click on the Facebook logo.
The answer will depend on how your app allow users to start the authentication process.
An example many have is:
- user arrives at your app and is not registered with it.
- they have to click a link to begin the registration (authentication) process.
- clicking the link shows the facebook logo. clicking the facebook logo shows the authentication dialog.
Most people complain that step 3 has the "extra" step of showing the facebook logo.
ANSWER: Change your link:
FROM: <a href="<?=$loginUrl?>">
TO: <a target="_top" href="<?= $loginUrl ?>
[there are several ways to accomplish what you are asking, this answer shows the one people seem to ask about the most, you would need to provide more details if this does not apply]
Facebook does not allow the user to login via an iframe, as with most oAuth.
加载中,请稍侯......
精彩评论