pay.ang
pay.ang

Reputation: 13

How to set SNC parameters for node-rfc?

I am trying to use node-rfc to perform CRUD operations. The system I am trying to use has a SNC.

I do not know how to explain it well but SNC is a multifactor authentication.

I am using following parameters

var abapSystem = {
    sncName: 'p/secude:CN=<SYSTEM>,O=<COMPANY>,C=US',
    ashost: 'something.db.com',
    sysnr: '00',
    client: '400',
    SNC_MODE: '1'
};

and getting an error

Invalid arguments supplied for SNC-API call

Does anyone know how to set it up?

Full code:

var rfc = require('node-rfc');
var abapSystem = {
    user: 'sap_user',
    passwd: 'sap_user_pwd',
    ashost: 'sap.nodomain',
    sysnr: '01',
    client: '800'
};
var client = new rfc.Client(abapSystem);
var MAX_ROWS = 3;
var SELECTION_RANGE_str = {
               PARAMETER: "USERNAME",
               SIGN:      "I",
               OPTION:    "CP",
               LOW:       "A*"
        };     
var SELECTION_RANGE_tab = [SELECTION_RANGE_str];

client.connect(function(err) {
    if (err) {
        return console.error('could not connect to server', err);
    }  
    client.invoke('BAPI_USER_GETLIST', {
                       MAX_ROWS: MAX_ROWS,
                       SELECTION_RANGE: SELECTION_RANGE_tab
        },
        function(err, res) {
            if (err) {
                return console.error('Error invoking BAPI_USER_GETLIST:', err);
            }
               console.log('Result BAPI_USER_GETLIST:', res);
        });   
});

Upvotes: 1

Views: 635

Answers (1)

Suncatcher
Suncatcher

Reputation: 10621

I do not know how to explain it well but SNC is a multifactor authentication

SNC is not a multifactor authentication. Period.

Read help thoroughly, it is SSO SAP technology with encryption.

I suppose the parameters should be following in your case:

var abapSystem = {
    'snc_mode' : '1',
    'snc_partnername': 'p/secude:CN=<SYSTEM>,O=<COMPANY>,C=US',
    'snc_lib': 'C:\\Program Files (x86)\\SECUDE\\OfficeSecurity\\secude.dll',
    'sysid': 'SDC',
    'ashost': 'something.db.com',
    'sysnr': '00',
    'client': '400',
    'lang': 'EN',
    'trace': '3'
};

See help for more details.

Also consider this thread (born from this) and SAP notes in it, some additional configuration is required in SAP backend. node-rfc was built on the same binaries as PyRFC so adheres the same principles.

Upvotes: 1

Related Questions