Metabase.getOAuthToken

Syntax

getOAuthToken (oauthService: PP.Mb.OAuthService, applicationUrl, callback);

Parameters

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.

Description

The getOAuthToken method requests a token for authentication on OAuth server.

Example

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:

Metabase