1 2 Previous Next 16 Replies Latest reply on Apr 20, 2017 10:09 AM by m.monti Go to original post
      • 15. Re: Teiid: User authentication for oData v4 query via javascript
        rareddy

        The "Error: A Security problem occurred" is probably from your script, which is hiding the real issue. Can you share your script or any there any logs, or do you have access to any http traffic monitoring tools (like Wireshack) to see which requests are failing?

        • 16. Re: Teiid: User authentication for oData v4 query via javascript
          m.monti

          Thank you for your hint.

           

          I developed a simple HTML page using the script and everything worked fine.

          Using the exactly same script from a Microsoft Office Web Add-in still returned me an error: in the end it turned out that the problem was caused by the Office Add-in using SSL.

           

          For completeness, here is the script that is working correctly:

                  var serviceUri = "http://Server/odata4/VDB/Model/Entity?$format=JSON";

                  $.support.cors = true;

                  $.ajax({
                      type: 'GET',
                      url: serviceUri,
                      dataType: 'json',
                      beforeSend: function (xhr) {
                          xhr.setRequestHeader("Authorization", "Basic " + btoa("User:Password"));
                      },
                      success: function (data) {
                          $.each(data.value, function (index, element) {
                              $('body').append($('<div>', {
                                  text: element.EntityName + ', ' + element.EntityDescription
                              }));
                          });
                      },
                      error: function (exch) {
                          errorHandler(exch.statusText);
                      }
                  });

          1 2 Previous Next