How to change SMS OTP passcode length

1. According to the document SMS OTP authentication using Web authentication , Netscaler generates a 6-digit random OTP passcode per user session and save it in the OTP store by configuring ns variable and ns assignment, the related configuration commands are as follows:

————

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)

————

Related:

  • No Related Posts

Leave a Reply