'how to call a JavaScript function in the callback URL (jsOAuth + twitter + non-PIN OAuth)

Learning about OAuth, I came across a big question. How to call a JavaScript function in the callback url with jsOAuth?

When you click Connect to twitter, the login screen opens, then the Twitter authorize APP and after he simply calls the callback URL. I would like to close this window and call a JavaScript function on the page that originated.

See my tests

Code

oauth = OAuth({
            consumerKey: srv.key,
            consumerSecret: srv.secret,
            requestTokenUrl: srv.request_token,
            authorizationUrl: srv.authorize,
            accessTokenUrl: srv.access_token,
            callbackUrl: "http://ridermansb.kodingen.com/twitter.html"
        });

Screenshots

I took some Screenshots will explain better:

Authorize

after

Callback

I asked this same question on GitHub;



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source