————
add ns variable otp_store -type “map(text(65),text(6),100000)” -ifValueTooBig undef -ifNoValue undef -expires 5
add ns assignment generate_otp -variable “$otp_store[AAA.USER.SESSIONID]” -set (“000000” + SYS.RANDOM.MUL(1000000).TYPECAST_UNSIGNED_LONG_AT.TYPECAST_TEXT_T).SUFFIX(6)
————
2. If we want to change the length of SMS OTP password, we need to modify the “Set Expression” of ns assignment and the “value length” of ns variable. Here are two examples:
【Example 1】If you want to change the length of SMS OTP passcode from 6-digit to 4-digit, please run below command in Netscaler CLI:
————
set ns assignment generate_otp -variable “$otp_store[AAA.USER.SESSIONID]” -set (“000000” + SYS.RANDOM.MUL(1000000).TYPECAST_UNSIGNED_LONG_AT.TYPECAST_TEXT_T).SUFFIX(4)
————
【Example 2】If you want to change the length of SMS OTP passcode from 6-digit to 8-digit, please run below command in Netscaler CLI:
————
set ns variable otp_store -type “map(text(65),text(8),100000)”
set ns assignment generate_otp -set (“00000000” + SYS.RANDOM.MUL(100000000).TYPECAST_UNSIGNED_LONG_AT.TYPECAST_TEXT_T).SUFFIX(8)
————