1

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);
        });   
});
Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
pay.ang
  • 13
  • 4
  • 1
    Make sure you provide details about what you tried, what you expect vs what's happening, and where you are stuck. Explain it as if you are speaking to someone who has no idea what SNC is and you'll reach a broader audience. – Wyck Jan 21 '20 at 18:10

1 Answers1

1

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.

Suncatcher
  • 10,355
  • 10
  • 52
  • 90
  • the following parameters worked for me ashost: 'something.db.com', sysId: '<3 LETTER ID>', sysnr: '00', client: '400', lang: 'EN', snc_partnername: 'p/secude:CN=,O=,C=US', thank you! thanks for explaining SNC too :) – pay.ang Jan 23 '20 at 08:42
  • I think the parameter 'snc_mode' : '1' would also be required in order to turn SNC on. Or does PyRFC set this automatically, when it detects one of the SNC parameters? I know that the underlying RFC library doesn't set it automatically. Also you may need 'snc_qop' : '9' in order to get the highest security (encryption plus digital signature). – Lanzelot Feb 11 '20 at 15:36
  • fair point, i suppose we missed it with OP, added now. thanks. Security pars are dependent on asker system settings, so it is up to him to adjust them – Suncatcher Feb 11 '20 at 15:47