Uploaded image for project: 'Help-Desk'
  1. Help-Desk
  2. HELP-8769

[fiware-stackoverflow] Fiware KeyRock sending Ajax requests with access token

    Details

      Description

      Created question in FIWARE Q/A platform on 27-10-2015 at 10:10
      Please, ANSWER this question AT https://stackoverflow.com/questions/33364204/fiware-keyrock-sending-ajax-requests-with-access-token

      Question:
      Fiware KeyRock sending Ajax requests with access token

      Description:
      I'm building a client for a FIWARE KeyRock GE instance in Javascript.

      I have a function for querying the instance (after a successful login flow in which I received an access_token):

      keyrockManager.query = function (uri, method, params, callback) {
      if (params == null)
      params = {};
      params.access_token = keyrockManager.getAccessToken();
      $.ajax(
      {
      url: KeyrockConfig.defaultInstanceUrl + uri,
      type: method,
      data: params,
      dataType: "jsonp",
      success: function (result, status, xhr)

      { alert("success"); }

      ,
      error: function (xhr, status, error)

      { alert("error"); }

      }
      );
      };

      I actually thought that an open API will allow all origins but it apparently not, so I'm using jsonp because of the CORS issue.

      For some reason I'm keep getting:

      Uncaught SyntaxError: Unexpected token :
      index.js:26 Error: jQuery1113013546996610239148_1445936551798 was not called(…)

      Any idea how to solve it ?

        Activity

        Hide
        backlogmanager Backlog Manager added a comment -

        2017-05-22 15:06|CREATED monitor | # answers= 0, accepted answer= False

        Show
        backlogmanager Backlog Manager added a comment - 2017-05-22 15:06|CREATED monitor | # answers= 0, accepted answer= False

          People

          • Assignee:
            aalonsog Alvaro Alonso
            Reporter:
            backlogmanager Backlog Manager
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: