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

FIWARE.Question.Tech.Apps.ApplicationMashup.ComponentDevelopment.ErrorUsingIdMTokenHeader

    Details

      Description

      Created question in FIWARE Q/A platform on 01-05-2016 at 01:05
      Please, ANSWER this question AT http://stackoverflow.com/questions/36961272/fiware-wirecloud-error-using-x-fi-ware-oauth-token-request-header

      Question:
      FIWARE Wirecloud: Error using X-FI-WARE-OAuth-Token request header

      Description:
      We are part of the FINISH accelerator and are deploying Wirecloud and KeyRock on our own servers using the docker containers provided by fiware.

      We have KeyRock-IdM set up and linked to Wirecloud. We are trying to pass the logged-in users token to an API which returns data to a widget.

      We found documentation about the "X-FI-WARE..." headers in the github code and wrote a test widget (main.js shown below). When deployed on the fiware labs instance, it works out of the box. When deployed on our local installation with a docker container it gives the following error: "Current user has not an active FIWARE profile". I scoured the settings.py file but have no idea where this error is coming from. I have DEBUG=True but nothing show up in the log. The user running the widget was logged in through the KeyRock IdM.

      /*jshint globalstrict:true */
      /global MashupPlatform, ObjectStorageAPI, StyledElements/

      (function () {

      "use strict";

      var token_available = MashupPlatform.context.get('fiware_token_available');
      var username = MashupPlatform.context.get('username');
      alert(username + " has token?: " + token_available);

      var url = MashupPlatform.prefs.get('keyRock_url');

      var request = MashupPlatform.http.makeRequest(url, {
      requestHeaders:

      { "X-FI-WARE-OAuth-Token": "true", "X-FI-WARE-OAuth-GET-Parameter": "access_token" }

      ,
      method: "GET",
      onSuccess: function (response)

      { alert("Success:" + JSON.stringify(response.responseText)); document.getElementById('response').textContent = response.responseText; }

      ,
      onFailure: function (response)

      { alert("Failed:" + JSON.stringify(response.responseText)); }

      ,
      onComplete: function () {
      }
      }
      );

      })();

      How can i find out what is going wrong?

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open In Progress In Progress
        5h 59m 1 Backlog Manager 01/May/16 9:02 AM
        In Progress In Progress Answered Answered
        3h 1 Backlog Manager 01/May/16 12:02 PM
        Answered Answered Closed Closed
        5d 6h 4m 1 Backlog Manager 06/May/16 6:07 PM

          People

          • Assignee:
            aarranz Álvaro Arranz
            Reporter:
            backlogmanager Backlog Manager
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: