getOAuthToken (oauthService: PP.Mb.OAuthService, applicationUrl, callback);
oauthService. Indicates OAuth server that will be used for authentication.
applicationUrl. URL to which the user will be sent from OAuth server.
callback. Callback function.
The getOAuthToken method requests a token for authentication on OAuth server.
Executing the example requires the web application of Foresight Analytics Platform. This requires that repository login using OAuth protocol is set up. Get a token for authentication in the OAuth server:
mb = PP.App.getMetabase();
mb.getOAuthToken(PP.Mb.OAuthService.Twitter, window.location.href, PP.Delegate(function (sender, args) {
var res = JSON.parse(args.ResponseText);
console.log(res.GetOAuthTokenResult.oauth_token)
}));
After executing the example the browser console displays a token for authentication in the OAuth server.
See also: