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

FIWARE.Request.Tech.Security.IDM-KeyRock.Trouble with authenticating a test web app using keyrock

    Details

      Description

      Created question in FIWARE Q/A platform on 12-08-2015 at 12:08
      Please, ANSWER this question AT http://stackoverflow.com/questions/31962695/trouble-with-authenticating-a-test-web-app-using-keyrock

      Question:
      Trouble with authenticating a test web app using keyrock

      Description:
      First we set up our app in the fiware lab:

      the code that we are using to create the app is on this site

      The only thing we changed from that link is the config.js:

      var config = {}

      config.idmURL = 'https://account.lab.fiware.org/';
      config.client_id = 'f9b5940d67a741a38039690e4d6e6c6f';
      config.client_secret = 'c9f854c96c9e4c70a0d402bce3233a17';
      config.callbackURL = 'http://panonit.com:8802/user_info';

      // Depending on Grant Type:
      // Authorization Code Grant: code
      // Implicit Grant: token
      config.response_type = 'code';

      module.exports = config;

      When deploying the node server we have the following site up and running (on a colleagues laptop):

      You can see it for yourself between the hours of 09h and 18h CET.

      After we click log in we are properly taken to the fiware site where the user can authenticate:

      And this is where the site breaks (it says page unavailable):

      To over come this issue we only changed the server.js to output only the response:

      // Ask IDM for user info
      app.get('/user_info', function(req, res){
      var url = config.idmURL + '/user/';

      // Using the access token asks the IDM for the user info
      oa.get(url, req.session.access_token, function (e, response)

      { //var user = JSON.parse(response); var user = response; console.log("Getting user response is: " + user) //res.send("Welcome " + user.displayName + "<br> Your email address is " + user.email + "<br><br><button onclick='window.location.href=\"/logout\"'>Log out</button>"); res.send("Welcome " + user) }

      );
      });

      After doing this we have restarted the server. From here we once again pressed the log in and authenticated the app usage and instead of the site break we get:

      here we have concluded that the response is an empty object because undefined is printed out.

      What are we doing wrong here?

        Activity

        Hide
        backlogmanager Backlog Manager added a comment -

        2015-10-14 06:05|CREATED monitor | # answers= 2, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2015-10-14 06:05|CREATED monitor | # answers= 2, accepted answer= True
        Hide
        backlogmanager Backlog Manager added a comment -

        2015-10-14 09:05|UPDATED status: transition Answer| # answers= 2, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2015-10-14 09:05|UPDATED status: transition Answer| # answers= 2, accepted answer= True
        Hide
        backlogmanager Backlog Manager added a comment -

        2015-10-14 12:05|UPDATED status: transition Answered| # answers= 2, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2015-10-14 12:05|UPDATED status: transition Answered| # answers= 2, accepted answer= True
        Hide
        backlogmanager Backlog Manager added a comment -

        2015-10-15 12:05|UPDATED status: transition Finish| # answers= 2, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2015-10-15 12:05|UPDATED status: transition Finish| # answers= 2, accepted answer= True

          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: