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

[fiware-stackoverflow] fiware POI: cannot add poi: always unauthorized

    Details

      Description

      Created question in FIWARE Q/A platform on 14-10-2016 at 12:10
      Please, ANSWER this question AT https://stackoverflow.com/questions/40040756/fiware-poi-cannot-add-poi-always-unauthorized

      Question:
      fiware POI: cannot add poi: always unauthorized

      Description:
      I have two instances:

      keyrock
      Poi with wilma-proxy

      Trying to create a poi in instance, allways the response is 401 Permission denied. But token is correct as said proxy log:

      2016-10-14 09:40:30.132 - INFO: IDM-Client - Token in cache, checking timestamp...
      2016-10-14 09:40:30.135 - INFO: IDM-Client - Token in cache expired
      2016-10-14 09:40:30.136 - INFO: IDM-Client - Checking token with IDM...
      2016-10-14 09:40:30.342 - INFO: Root - Access-token OK. Redirecting to app...
      Refused to set unsafe header "content-length"
      2016-10-14 09:40:30.366 - ERROR: HTTP-Client - Error: 401 Permission denied.

      So, i think the problem is the authenticate.html file. The only lines i changed are:

      <meta name="fiware_lab-signin-client_id"
      content="8dc5826cdaea4729a4f43a01d01cb32e">
      <meta name="fiware_lab-signin-host" content="http://myserver.com:8000">

      fiware_lab-signin-client_id has the client_id of application POI created in my keyrock instance.
      the fiware_lab-signin-host has the server AND port of horizon.

      Is that correct? I try with 5000 port (keystone) without results.

      Also, I found this in add_poi.php:

      $session = get_session();
      $user_id = $session['user'];
      $add_permission = $session['permissions']['add'];
      if(!$add_permission)

      { header("HTTP/1.0 401 Unauthorized"); die("Permission denied."); }

      If comment these lines, all proccess seems to be correct until the sql insert. (needs the $session['user'] and other parameters that are null)

      I dont understand why these lines are there. also, the function get_session() returns a hardcoded array and not the session (which may not have)

      I'm so confused how to use this enabler. Anyone knows how to use?

        Activity

        backlogmanager Backlog Manager created issue -
        backlogmanager Backlog Manager made changes -
        Field Original Value New Value
        Component/s FIWARE-TECH-HELP [ 10278 ]
        backlogmanager Backlog Manager made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        backlogmanager Backlog Manager made changes -
        Status In Progress [ 3 ] Answered [ 10104 ]
        fla Fernando Lopez made changes -
        Assignee Ari Okkonen [ ariokkon ]
        fla Fernando Lopez made changes -
        HD-Enabler POI Provider [ 10898 ]
        Description
        Created question in FIWARE Q/A platform on 14-10-2016 at 12:10
        {color: red}Please, ANSWER this question AT{color} https://stackoverflow.com/questions/40040756/fiware-poi-cannot-add-poi-always-unauthorized


        +Question:+
        fiware POI: cannot add poi: always unauthorized

        +Description:+
        I have two instances:


        keyrock
        Poi with wilma-proxy


        Trying to create a poi in instance, allways the response is 401 Permission denied. But token is correct as said proxy log:

        2016-10-14 09:40:30.132 - INFO: IDM-Client - Token in cache, checking timestamp...
        2016-10-14 09:40:30.135 - INFO: IDM-Client - Token in cache expired
        2016-10-14 09:40:30.136 - INFO: IDM-Client - Checking token with IDM...
        2016-10-14 09:40:30.342 - INFO: Root - Access-token OK. Redirecting to app...
        Refused to set unsafe header "content-length"
        2016-10-14 09:40:30.366 - ERROR: HTTP-Client - Error: 401 Permission denied.


        So, i think the problem is the authenticate.html file. The only lines i changed are:

        &lt;meta name="fiware_lab-signin-client_id"
        content="8dc5826cdaea4729a4f43a01d01cb32e"&gt;
        &lt;meta name="fiware_lab-signin-host" content="http://myserver.com:8000"&gt;


        fiware_lab-signin-client_id has the client_id of application POI created in my keyrock instance.
        the fiware_lab-signin-host has the server AND port of horizon.

        Is that correct? I try with 5000 port (keystone) without results.

        Also, I found this in add_poi.php:

        $session = get_session();
          $user_id = $session['user'];
          $add_permission = $session['permissions']['add'];
          if(!$add_permission) {
            header("HTTP/1.0 401 Unauthorized");
            die("Permission denied.");
          }


        If comment these lines, all proccess seems to be correct until the sql insert. (needs the $session['user'] and other parameters that are null)

        I dont understand why these lines are there. also, the function get_session() returns a hardcoded array and not the session (which may not have)

        I'm so confused how to use this enabler. Anyone knows how to use?
        Created question in FIWARE Q/A platform on 14-10-2016 at 12:10
        {color: red}Please, ANSWER this question AT{color} https://stackoverflow.com/questions/40040756/fiware-poi-cannot-add-poi-always-unauthorized


        +Question:+
        fiware POI: cannot add poi: always unauthorized

        +Description:+
        I have two instances:


        keyrock
        Poi with wilma-proxy


        Trying to create a poi in instance, allways the response is 401 Permission denied. But token is correct as said proxy log:

        2016-10-14 09:40:30.132 - INFO: IDM-Client - Token in cache, checking timestamp...
        2016-10-14 09:40:30.135 - INFO: IDM-Client - Token in cache expired
        2016-10-14 09:40:30.136 - INFO: IDM-Client - Checking token with IDM...
        2016-10-14 09:40:30.342 - INFO: Root - Access-token OK. Redirecting to app...
        Refused to set unsafe header "content-length"
        2016-10-14 09:40:30.366 - ERROR: HTTP-Client - Error: 401 Permission denied.


        So, i think the problem is the authenticate.html file. The only lines i changed are:

        &lt;meta name="fiware_lab-signin-client_id"
        content="8dc5826cdaea4729a4f43a01d01cb32e"&gt;
        &lt;meta name="fiware_lab-signin-host" content="http://myserver.com:8000"&gt;


        fiware_lab-signin-client_id has the client_id of application POI created in my keyrock instance.
        the fiware_lab-signin-host has the server AND port of horizon.

        Is that correct? I try with 5000 port (keystone) without results.

        Also, I found this in add_poi.php:

        $session = get_session();
          $user_id = $session['user'];
          $add_permission = $session['permissions']['add'];
          if(!$add_permission) {
            header("HTTP/1.0 401 Unauthorized");
            die("Permission denied.");
          }


        If comment these lines, all proccess seems to be correct until the sql insert. (needs the $session['user'] and other parameters that are null)

        I dont understand why these lines are there. also, the function get_session() returns a hardcoded array and not the session (which may not have)

        I'm so confused how to use this enabler. Anyone knows how to use?
        HD-Chapter WebUI [ 10842 ]
        fla Fernando Lopez made changes -
        Resolution Done [ 10000 ]
        Status Answered [ 10104 ] Closed [ 6 ]
        fla Fernando Lopez made changes -
        Fix Version/s 2021 [ 12600 ]

          People

          • Assignee:
            ariokkon Ari Okkonen
            Reporter:
            backlogmanager Backlog Manager
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: