Facebook Connect cancel button not working - api

I'm using facebook connect for a little website. This is my pop-up request URL:
https://www.facebook.com/dialog/oauth?client_id=".$app_id."&redirect_uri=".urlencode($redirect_url)."&scope=email,read_stream,publish_stream,publish_checkins,offline_access,friends_checkins,user_checkins&display=popup
The problem is, I have to buttons: Login and Cancel. When I click on cancel I go back to the login page, instead of closing the window. Any ideas?
Thanks.

This is a desired behavior of OAuth Dialog no matter which button user is clicks redirection (to URL specified in redirect_uri) occurs.
Some of the reasons that window isn't closed by clicking on Cancel and additional notes:
Closing of windows not opened by script is blocked in most browsers by default.
Closing of window is a feature that require JavaScript solution and OAuth dialog URL provides ability not to rely on this.
You can use JS-SDK with FB.login which will provide this for you and will close dialog.

Related

How do I prevent a url from being displayed outside Messenger webview? e.g. directly in a browser

I'm working on an experience that should happen exclusively inside Messenger. How do I prevent an url from being displayed outside the webview. For example: user taps on 'Copy Link' and opens it in a browser.
Also, any way to disable the share button in a Messenger webview altogether?
There is no way to prevent the user from opening the link in another browser. Best you could do is detect the user agent on the page, then display an error that redirects to the bot and then resend a message with the URL button.
You can also set webview_share_button to false on the url button:
https://developers.facebook.com/docs/messenger-platform/reference/buttons/url

QWebView pop-up window asking for credentials

I have a QTWebkit simple browser that works until it opens a pop-up windows inside a security page (with login/password) and the new window redirects me to input the credentials again.
I can't find a way/examples/books/forums that deals with this problem.
Could anyone point me to a direction, or provide a simple example on how to keep the logged user to access the pop-up/new window resources in the web page ?
Thanks in advance

Webview in Cocoa Application not proceed for authentication dialog?

I am trying to make a request through Webview (webkit) within cocoa application to a secured website. After the webframe launched, an authentication dialog pops up in the Webview let user to type username and password. However, after user click login button, authenticate dialog disappeared, but no request is generated and send to the server, thus none of the webview delegate method can catch this event. The webview hang with no content in it in the end.
I tried to use the delegate method didReceiveAuthenticationChallenge and hard code my credential in this method to challenge the authentication dialog, the website let me pass through without the authentication dialog pop up. However, I need to let user to type in credential after authentication dialog pop up.
Any one has idea on how to implement a Webview that can handle authentication dialog login after user input credential? Or is this a Webkit bug that does not handle this workflow?
BTW, if I make the same request in Safari, I can see dialog popup, I entered credential, the browser proceed and server let me logged in.
Thank you.

Authentication within page tab by redirect instead of popup

How do I redirect a user who enters a Facebook page tab that runs a Facebook application (instead of a popup to the login page of my app) and then redirect back to page tab?
Oh ok,
You need to invoke the popup on user input. If the user clicked something like "Begin Game" or whatever on the landing page, it will not get blocked by popup blockers.
It has to be in an onclick or onmouseup event etc. That will bypass popup blocking.

System.Windows.Forms.WebBrowser login dialog doesn't appear

When I navigate to an intranet site requiring windows authentication, the WinForms WebBrowser control isn't displaying a login dialog. But it will display (after refreshing the page) if I first open Internet Explorer and view the same page.
Also, if I make the URL refer to my local IIS instance, the login dialog will appear.
Any ideas? Thanks!
You can send credentials via IAuthenticate. You can either extend the winform webbrowser site or write your own webbrowser wrapper.