01-25-2016 07:28 AM
I am building a new Widget which resides on a separate server.
I took the SampleGadget demo from the Finesse web site and I have a problem with V 11.0 which I work with.
I added to the creation of User an error handler:
user = new finesse.restservices.User({
id: id,
onLoad : handleUserLoad,
onChange : handleUserChange,
onError: handleUserError
});
And when I run, I receive the following error:
LearningSampleGadget : Handle User Error start concat:15999:17
LearningSampleGadget : Error-Status:401 concat:15999:17
Error-content:...... This request requires HTTP authentication. .......
Seems as I miss Authentication.
Therefore I tried a few things:
- I checked the value of '_prefs.getString("authorization")' and it's empty. So I create it using 'finesse.gadget.Config.authorization = btoa(id + ":" + my_password);'. Still 401
- I also noticed that remoteHost points to localhost so I changed it to the Finesse host. Still 401
- I wanted to turn on the internal logs of finesse.js and I was not successful (any one knows how to do it?)
I appreciate any help.
Solved! Go to Solution.
02-29-2016 04:09 PM
This post seems to be a duplicate of Authorization with V11 when running widget from another server
01-26-2016 03:13 PM
One difference with version 11, is that the Finesse and jQuery libraries are hosted on one location, instead of residing on each gadget folder...
<!-- jQuery -->
<script type=
"text/javascript"
src=
"/desktop/assets/js/jquery.min.js"
></script>
<!-- Finesse Library -->
<script type=
"text/javascript"
src=
"/desktop/assets/js/finesse.js"
></script>
01-31-2016 10:29 PM
Thanks for the suggestions. I tried them all without success.
However, I noticed that although I receive 401 on handleUserLoad, I do receive calls to handleUserChange! No doubt it is strange however it was enough for me to perform my task. Although I don't receive handleNewDialog and handleNewDialog because handleUserLoad was not called, I do perform the following in handleUserChange:
dialogCollection = _dialogs.getCollection(); | |
for (dialogId in dialogCollection) { | |
if (dialogCollection.hasOwnProperty(dialogId)) { | |
return handleNewDialog(dialogCollection[dialogId]); | |
} | |
} |
this overcomes the problem. In addition, if I perform the above loop without handling new dialog it means we have no dialogs.
Thanks again for your help. Once the above will be fixed I'll change my code accordingly.
02-29-2016 04:09 PM
This post seems to be a duplicate of Authorization with V11 when running widget from another server
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