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

[fiware-stackoverflow] FIWARE IoT Agent Authentication: 401 Unauthorized on Port 7897 & Missing User in Keyrock

    Details

      Description

      Created question in FIWARE Q/A platform on 21-02-2025 at 09:02
      Please, ANSWER this question AT https://stackoverflow.com/questions/79456914/fiware-iot-agent-authentication-401-unauthorized-on-port-7897-missing-user-in

      Question:
      FIWARE IoT Agent Authentication: 401 Unauthorized on Port 7897 & Missing User in Keyrock

      Description:
      I am securing both the northbound (4041) and southbound (7897) interfaces of an IoT Agent in FIWARE using Keyrock for authentication and authorization. However, I am facing two issues:
      401 Unauthorized Error on Port 7897:
      I have successfully secured the northbound interface (4041) using a permanent token and provisioned a sensor with it. I have tried retrieving permanent token to secure north port of iot agent by creating appropriate service group and provisioning a sensor, using both the "iot sensor" user and the "alice-the-admin" user.
      When trying to send data to the IoT Agent on port 7897 using an access token obtained for the "iot sensor" user, I receive the following response:
      {
      "type": "urn:dx:as:InvalidRole",
      "title": "Unauthorized",
      "detail": "User access-token not authorized"
      }

      Unable to Assign Roles and Permissions to IoT Sensor User in Keyrock:
      P.S: The "iot sensor" user is correctly defined in the IoT Sensors section of the application.
      However, this user does not appear in Keyrock's control panel under the list of users.
      Because of this, I am unable to assign roles and permissions to this user.
      Steps I have taken:

      Ensured that the IoT Agent is configured to require authentication for southbound communication.
      Verified that the token is valid and not expired.
      Attempted to manually assign roles in Keyrock, but the user is not
      listed. So I created the same user name as "iot sensor" user and assigned a role (/iot.*) but the error persisted as before

        Activity

        Hide
        newbacklogmanager Backlog Manager added a comment -

        2025-02-22 01:02|CREATED monitor | # answers= 0, accepted answer= False

        Show
        newbacklogmanager Backlog Manager added a comment - 2025-02-22 01:02|CREATED monitor | # answers= 0, accepted answer= False

          People

          • Assignee:
            Unassigned
            Reporter:
            newbacklogmanager Backlog Manager
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: