Blogs

Showing 1 - 5 of 22 results.
Items per Page 5
of 5

Forums

« Back to General Questions

need to use "getCredentials(parameter);" method from finesse.js

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
I need to use "getCredentials(parameter);" method from finesse.js, to get username and password in a third party gadget for it's login and  subscription, how can i access this method?

or if I have to access 'user ID and password' via _config object, like
var userId=_config.id, var password=_config.password;
for my gadget, so that it can subscribe to finesse notifications, then how can I do this?

getCredentials is used to extract the credentials from the config object. I found an example in the Finesse desktop:

//If the authorization string is provided, then use that to
//extract the ID and the password. Otherwise use the ID and
//password from the respective ID and password params.
if (_config.authorization) {
var creds = _util.getCredentials(_config.authorization);
_config.id = creds.id;
_config.password = creds.password;

You should be able to access the method by calling _util.getCredentials(_config_authorization);


Finesse client services are initialized with the config when the finesse gadget is loaded:

finesse.clientservices.ClientServices.init(finesse.gadget.Config);

Here is how you get the gadget config (from the SampleGadget_Final.js sample gadget):

// Configuration for the gadget
finesse.gadget.Config = (function () {
var _prefs = new gadgets.Prefs();

/** @scope finesse.gadget.Config */
return {
authorization: _prefs.getString("authorization"),
host: _prefs.getString("host"),
restHost: "localhost"
};
}());

Collateral


No files available