This document was generated from CDN thread
Created by: Absaar Javed on 15-02-2013 01:54:10 AM
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?
Subject: RE: New Message from Absaar Javed in Cisco Finesse - General Questions: RE:
Replied by: Absaar Javed on 15-02-2013 07:20:23 AM
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?
Subject: RE: New Message from Absaar Javed in Cisco Finesse - General Questions: RE:
Replied by: David Lender on 15-02-2013 09:38:35 AM
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"
};
}());