09-29-2014 02:55 AM
Hi all,
I got some issues when I authenticated end user against CUCM.
Something wrong with my environment or I didn't get the points?
Thanks, Jeff
Solved! Go to Solution.
10-13-2014 05:46 AM
Hi Jeff,
Unfortunately, you cannot accomplish that kind of login process. SSO is not supported right now. It is on the features list for the next major release, which is planned for the first half of 2015. In the current release, you must enter the password each time you want to login to your web app.
Regards, Milos.
09-30-2014 12:31 AM
Hi Jeff,
As I could see from information that you have provided, the problem is most probably your 'null' in 'Password' input field.
If you want to authenticate user and get the list of available devices for that user, you must enter password.
When password is not provided, CWIC tries to predict device name like 'ECP' + 'Username'. If your SoftPhone device name is not in that format, login will fail. You have option to add 'predictDevice' function and 'devicePrefix' property in 'init' settings which could be used to change prediction algorithm. Anyway if you want to use basic authentication based login, you must enter valid password.
Regards,
Milosh.
09-30-2014 01:29 AM
Hi Milosh,
Deeply appreciate your replay.
Honestly, I wanna realize the CUCM sso. (Not sure if named it be ok)
For now, I add some code in the "cwic.js", it works.(See the attach)
My "settings":
var settings = {
ready: phoneReadyCallback, /* Callback when phone is ready for use */
error: phoneErrorCallback, /* Error callback */
encodeBase64: ciscobase.util.crypto.b64Encode,
verbose: true,
node: 'http://localhost:1789',
contactLookupJsonpHost: ""
};
I'll try to add "predictDevice" and "devicePrefix" in my "init settings".
I'v added the "predictDevice" and "devicePrefix" in my "init settings".
devicePrefix: 'CSF',
predictDevice: function(args) {
return settings.devicePrefix+args.username;
},
It doesn't work either.
But what makes the call back value "devices" is "".
I'll contiue working on it. (m off from October 1st to October 7th )
Thanks Jeff.
10-02-2014 07:31 AM
Hi Jeff,
You should not change cwic.js unless you are doing some experimentation on your own. You can put all code in sample.html or your own separate file.
If I understand you right, you want to use node.js component to get the list of available devices for the user and to use it to login without password. Am I right?
As I see in attached print-screens, the success callback is executed but devices argument is empty. Is that the problem that you are facing?
I will setup node.js component on my machine and I will try to make some sample code to help you.
Regards, Milos.
10-02-2014 09:05 PM
Hi Milos,
1. Of course I won't change cwic.js in the furture.
2. You are right. I wanna use Node.js to auth the user against CUCM(without password).
At first, I have to get the list of available devices.
It seems this needs password.
When I run the csf API in the browser "http://localhost:1789/phoneconfig/devices?ccmcip=<my CUCM IP>", it works after validating the UserName and Password.
But in the cwic.js, GET "/phoneconfig/devices?ccmcip=my CUCM IP" via ajax, password is not provided.
3. Yes, the success callback is empty. This is the point I am facing!
4. I'll focus on how it works inside if possible.
Thanks Jeff.
10-09-2014 02:04 AM
Hi Jeff,
you definitely need to enter your credentials somewhere. I have tried to get devices through node.js and I did it successfully. Here is my code, maybe it could help you:
$.ajax({
url:'http://localhost:1789/phoneconfig/devices?ccmcip=x.x.x.x',
beforeSend: function(xhr){
var encoded = window.btoa('username:password'); // note ":"
xhr.setRequestHeader("Authorization", "Basic " + encoded);
},
success:function(devices){
console.log(devices); //the list of devices
},
error: function(err) {console.log(err);}
});
You also need to configure CORS to support Authorization header. You have attached sample config file where you can see how to do it. After that, you should run node component with new config file as a second argument, like:
node node_modules/csf/csf.js node_modules/csf/config/your_config_file.cfg
Regards, Milos.
10-09-2014 08:24 PM
Thanks for your reply.
$.ajax({
url: settings.node + '/phoneconfig/devices' + '?ccmcip=' + cucmAddress,
beforeSend: function(req) {
var auth = 'Basic ' + _encodeBase64(registration.user + ':' + clearPassword);
req.setRequestHeader('Authorization', auth);
},
error: function(jqXHR, textStatus, errorThrown) {
_log(true, 'CCMCIP failure with CUCM "' + cucmAddress + '" : ' + textStatus, errorThrown);
authenticateCcmcip(); // try next CUCM address
},
success: function(devices) {
.....
}
});
I valued the 'clearPassword', it works.
Let's see a situation:
User sign in the company domain with his PC.
The program would get the 'username', his PC's MAC Address, etc. Just except password.
When the user visit the Jabber Web app, SSO would be helped via the 'username'.
Would this be possible?
BTW, something wrong with CWIC.js? The 'selectedDevice' is valued to 'undefined'. Console showed like:
"ready for devicesAvailableCb:: selectedDevice:" null cwic-debug.js:2580
"valued selectedDevice" undefined cwic-debug.js:2585
"devicesAvailableCb end:: selectedDevice:" undefined cwic-debug.js:2600
"if selectedDevice is null:: selectedDevice:" undefined cwic-debug.js:2602
"selectedDevice::" undefined
At last, 'selectedDevice' is undefined.
I valued it to 'CSFxxxx' myself.
Many Thanks,
Jeff
10-13-2014 05:46 AM
Hi Jeff,
Unfortunately, you cannot accomplish that kind of login process. SSO is not supported right now. It is on the features list for the next major release, which is planned for the first half of 2015. In the current release, you must enter the password each time you want to login to your web app.
Regards, Milos.
10-13-2014 06:14 PM
Hi Milos,
Deeply appreciate your help!
I will focus on the new release.
Thanks
Jeff
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide