HTTP request works on Postman but not on nodered

Hello,
simple Http request flow:

[
    {
        "id": "e37a75d751c4f850",
        "type": "http request",
        "z": "2be6ebd2e3410b48",
        "name": "",
        "method": "GET",
        "ret": "txt",
        "paytoqs": "ignore",
        "url": "https://mlps.tgw-group.com/api/v1/site/41292715774940/siteStructure",
        "tls": "",
        "persist": false,
        "proxy": "",
        "insecureHTTPParser": false,
        "authType": "basic",
        "senderr": false,
        "headers": [],
        "x": 650,
        "y": 600,
        "wires": [
            [
                "632ac93625013e11"
            ]
        ]
    },
    {
        "id": "07484e56837a60da",
        "type": "inject",
        "z": "2be6ebd2e3410b48",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 500,
        "y": 600,
        "wires": [
            [
                "e37a75d751c4f850"
            ]
        ]
    },
    {
        "id": "632ac93625013e11",
        "type": "debug",
        "z": "2be6ebd2e3410b48",
        "name": "Response",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 800,
        "y": 600,
        "wires": []
    }
]

generates response with Code: 403. Payload:

<?xml version="1.0" encoding="utf-8"?>
<Error><Code>AuthenticationFailed</Code><Message>Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
RequestId:9721d755-801e-000d-0c42-5b227a000000
Time:2024-02-09T10:27:35.5931872Z</Message></Error>

If I change any character in user or password I receive Code:401

Postman setup works fine:

What am I missing?
Nodered v. 3.0.2

npm request package has been deprecated

NR migrated: Migrate away from request package · Issue #2481 · node-red/node-red · GitHub

managed to get it working with node: node-red-contrib-http-request
also by importing old request npm in function:

const user = "user"
const psw = "psw"
const url = 'https://url'
let auth = 'Basic ' + Buffer.from(user + ':' + psw).toString('base64');

request(
    {
        url: url,
        method: "GET",
        headers: {
            'Authorization': auth,
            'Content-Type': 'application/json'
        }
}, function (error, response, body) {
    if (!error && response.statusCode == 200) {
        node.send({ 'body': body });
    } else {
        node.error(response);
    }
});

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.