0

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

willsteel
  • 1,037
  • 2
  • 12
  • 21

1 Answers1

2

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.

Ryan Baxter
  • 1,237
  • 2
  • 8
  • 16
  • Thanks for the comment Ryan, in case of successful authorization the IBM Connections gadget container closes the popup its not me as a oauth provider who is closing it, only in case of deny the tab doesn't close. since the tab is opened by the open social gadget i don't have the control to save that tab. – willsteel Aug 02 '13 at 11:49
  • OK I take back what I said before :) It is the result of calling the callback that should close the window. What does your request to the callback URL look like? From looking at the code it looks like if callback URL is not called with a "cs" parameter or the "cs" parameter is invalid we will not close the window. – Ryan Baxter Aug 11 '13 at 02:17