UserCreds.OAuth

Syntax

OAuth: PP.Mb.OAuthLogonData

Description

The OAuth property sets user credentials 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. Address bar of the HTML page must contain the oauth_token and oauth_verifier parameters. These parameters will be available in the address bar of the page that opens on clicking the Authorize button in Twitter.com. Execute the following code in the console to open repository with the OAuth protocol:

var mb = new PP.Mb.Metabase({

   Id: "pprepository", UserCreds:{

   OAuth: new PP.Mb.OAuthLogonData({

       OAuthService: PP.Mb.OAuthService.Twitter,

       OAuthToken: PP.App.getQueryParam("oauth_token"),

       OAuthVerifier: PP.App.getQueryParam("oauth_verifier")

      })

   }

});

mb.open();

mb.Opened.add(function(){"repository is opened"});

 

After executing the example repository with specified identifier opens using the OAuth protocol, and the browser console displays an appropriate message.

See also:

UserCreds