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

        Hide
        backlogmanager Backlog Manager added a comment -

        2016-05-01 03:05|CREATED monitor | # answers= 0, accepted answer= False

        Show
        backlogmanager Backlog Manager added a comment - 2016-05-01 03:05|CREATED monitor | # answers= 0, accepted answer= False
        Hide
        backlogmanager Backlog Manager added a comment -

        2016-05-01 09:05|UPDATED status: transition Answer| # answers= 1, accepted answer= False

        Show
        backlogmanager Backlog Manager added a comment - 2016-05-01 09:05|UPDATED status: transition Answer| # answers= 1, accepted answer= False
        Hide
        backlogmanager Backlog Manager added a comment -

        2016-05-01 12:05|UPDATED status: transition Answered| # answers= 1, accepted answer= False

        Show
        backlogmanager Backlog Manager added a comment - 2016-05-01 12:05|UPDATED status: transition Answered| # answers= 1, accepted answer= False
        Hide
        backlogmanager Backlog Manager added a comment -

        2016-05-06 18:05|UPDATED status: transition Finish| # answers= 3, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2016-05-06 18:05|UPDATED status: transition Finish| # answers= 3, accepted answer= True

          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: