Closing Open Social Gadget Popup - opensocial

I have written an Open Social OAuth enabled Gadget in IBM Connections 4.0 and the OAuth Provider Service is also written by me as well, the problem I am facing is while authorizing the gadget through OAuth flow I open the popup using the following code
var popup = new gadgets.oauth.Popup(oauthApprovalUrl, null, onOpen,onClose);
and upon successful authorization the popup closes automatically but in case when the user Denies the access to the app my oauth service redirects to the callback url but after that redirection the popup is not getting closed I tried with following callback url.
https://<host>/connections/opensocial/gadgets/oauth2callback
Any help on this regard is greatly appreciated
Thanks

It is up to the OAuth provider to close the window if the user denies or approves access. Some providers, like DropBox, don't close the window in either case. The gadget code doesn't not know if the user approved or denied access. All the OAuth popup code does is poll to see if the window it opened has been closed or not.

Related

Response state param did not match request state error when integrate flutter with keycloak

I implement authentication for the Flutter app using the Keycloak. My flow is:
When opening the app for the first time, the user will be redirected to the login page of Keycloak with an email input
After inputting the email, a magic link will be sent to the email to authorize
When clicking the magic link, the app is opened and redirected to authenticate page of Keycloak. If the link is valid, the user will be forced to register the Webauthn passwordless
After registering success, back to the app
I've already implemented the magic link authenticator and it's working fine. My problem is when back to the app, I got the error: "Response state param did not match request state". I guess that because the app is open the browser 2 times: The first time to open the input email form to log in and the second time when open the magic link.
I've searched on the internet but can't find the solution. Any solution or hint?
Thanks.

fb app not requesting all permissions

I´ve written a facebook connector app which should request some permissions.
When I click the preview login dialog button in the applications edit menu all the permissions are listed but when I open the login dialog from my website only the standard permissions (general user information) are requested. I´ve already saved it several times and waited for hours but it doesn´t work.
Am I doing anything wrong or did I just discover a bug or something?
Thanks.
The permission settings in your Facebook application configuration only apply to auth dialogs from the Facebook app center. You need to specify the permissions you want when you are opening the login dialog from your website. For example, if you're using the Javascript SDK's FB.login to do login, you will need something like
FB.login(function(response) {
// handle the response
}, {scope: 'email,publish_actions'})
Pay particular attention to the scope parameter.

Facebook permission dialog opens automatically for new visitors at start, asking for basic permissions

I have a facebook iframe app, and I have just noticed that a basic permission dialog is fired for every new visitor. This dialog is launched by Facebook, not by my application (index.php hasn't been called yet).
This behavior is new, and not wanted : users are allowed to visit some pages of the app and later are asked for extended permissions.
At first I though it was the new open graph feature, but removing it didn't help. I don't use the new Enhanced Auth Dialog either. I tried turning social discovery on and off also.
Does anyone else has experienced this behavior ?
Thanks!
Check you haven't enabled Authenticated Referrals in your app settings

Facebook Connect Bug? (Post-Authorise URL Being Put in Window Instead of OnLogin Callback)

I have a ASP.NET web site which uses Facebook Connect for authentication - using the JavaScript API and the Facebook Connect FBML Button.
Here is the regular flow of events for a "Connect with Facebook" button click, when user isnt logged into Facebook.
Dialog is shown requesting user to login
Dialog requests permission from the user for basic info permission
The popup is closed
The callback function i supplied for "onlogin" is fired.
All good.
Now - here's what i think is a bug: the user is already authenticated to Facebook, but has not authorised my app.
This is the flow:
Dialog is shown requesting permission from the user for basic info permission
The URL for the popup changes to http://rootofmysite.com/?installed=1&token=3e3920d309
The user is left wondering what is going on, and the onlogin callback is NOT fired.
So, the popup window is replaced with my original site, and in the querystring is the OAuth token? This looks to be the "Post-Authorise Callback" URL which used to be in the Facebook Application Settings - but has been removed. Anyway, i dont care about this URL - i request permissions/authorization using the client-side JavaScript API, as im a sure a lot of people do.
I understand the user is already authenticated, so they wouldn't need to login again, but what i dont understand is a) why the "onlogin" event handler is not called, and b) why on earth are they replacing THEIR dialog with my site and the OAuth token in the url?
At the moment, i am trying to do a "creative workaround" where i detect this URL and close the popup and call my "onlogin" handler manually (what Facebook SHOULD be doing).
Still, quite dodgy.
EDIT
It's another bug peoples. Please vote for it so they fix it.
It's a (unconfirmed) bug.
http://bugs.developers.facebook.net/show_bug.cgi?id=12260
Hopefully it gets more votes so it gets fixed - vote people!
In the meantime, i am (attempting) to employ the following 'creative workaround':
Add logic to my Default.aspx page to detect that URL they are redirecting to in the popup.
Redirect to my page, FacebookInboundAuthorization.aspx, preserving querystring.
On load of that page, register some JavaScript to close the popup and manually fire the "onlogin" event handler for my button.
EDIT
To clarify my above, i didnt mean "vote people" as in to vote for my answer here, i meant vote for the bug on Bugzilla (so that FB accept it as an issue and fix it).

Facebook Login Window Not close after Successfull login

I have implemented Facebook Connect with ASP.Net 3.5. My problem is when i click on Face book login the small window will open. when i pass the valid credential it will redirected to URL which i specified in Connect URL in Facebook application on developer.facebook.com. The main problem is this page is redirected on same page (small login page). not in new page. I want that if user logged in then that login window will be closed and main window will be redirected to url
Is there anything i missing in Facebook application setting?
is there anything missing in library or in javascript?
Thanks in advance
I think it's the same question of this post: Facebook Connect Dialog Box doesn't close