cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2419
Views
0
Helpful
3
Replies

401 Authorization error with V 11

gfoster1
Level 1
Level 1

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.

1 Accepted Solution

Accepted Solutions
3 Replies 3

ewindgat
Level 5
Level 5

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>
Please check your security settings.
Also, using // for a protocol instead of HTTP or HTTPS could help. Depending on your settings, mixed mode, between HTTP and HTTPS may cause problems.

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.