Script 1: Using RSA SecurID as External Passcode Validation Service

This script performs the following tasks:
  • Sets a property that allows external passcode validation if the user is a member of a specific group.
  • Validates the external passcode that the user provides and informs the user about the log-on result.
#include SAP;
#include SAP_util_rsa;

function onFirstStageLogin(config, context, result){
    var loginInfo = context.getLoginInfo();
    if (loginInfo.getUser().isMemberOfGroup("GRUP.PRIVATE_DATASOURCE.un:RSA_Users", true)) {
        config.setProperty("otp.use.external.passcode.validation", "yes");
    }
}
function validatePasscode(config, context, result, username, passcode) {
    SAP.util.rsa.PasscodeValidator.validate(config, context, result, username, passcode);
}