Citrix ADC

SMS two factor authentication using Web authentication

Citrix ADC can now be integrated with a third party SMS provider to provide an extra layer of authentication.

Citrix ADC appliance can be configured to send an OTP on the user’s mobile as a second factor of authentication. The appliance presents the user with a logon form to enter the OTP after successful AD login. It is only after the successful second factor authentication the user is presented with the requested resource.

Configure SMS two factor authentication with Citrix ADC

Before you configure the SMS two factor authentication feature, you must have an LDAP authentication configured on a Citrix ADC appliance as first factor with authentication enabled. For instructions to configure LDAP authentication, see To configure LDAP authentication by using the configuration utility.

Note

Mobile number can be extracted using AAA.USER.ATTRIBUTE(1) and can be included while sending it to a back-end server.

Assign NS variable

At the command prompt, type the following commands:

add ns variable <variable name> -type "map(text(65),text(6),100000)" -ifValueTooBig undef -ifNoValue undef -expires 5

add ns assignment<variable name> -variable "$test[AAA.USER.SESSIONID]" -set ("000000" + SYS.RANDOM.MUL(1000000).TYPECAST_UNSIGNED_LONG_AT.TYPECAST_TEXT_T).SUFFIX(6)
<!--NeedCopy-->

Sample NS Variable assignment

add ns variable test -type "map(text(65),text(6),100000)" -ifValueTooBig undef -ifNoValue undef -expires 5

add ns assignment test -variable "$test[AAA.USER.SESSIONID]" -set ("000000" + SYS.RANDOM.MUL(1000000).TYPECAST_UNSIGNED_LONG_AT.TYPECAST_TEXT_T).SUFFIX(6)
<!--NeedCopy-->

Configure Webauth action

At the command prompt, type the following commands:

add policy expression <expression name> "\"method=sendMessage&send_to=&msg=OTP i \" + $test[AAA.USER.SESSIONID] + \"for login into secure access  gateway. Valid till EXPIRE_TIME. Do not share the OTP with anyone for security reasons.&userid=#####&password=###=1.0\""

add authentication webAuthAction webAuth_Get -serverIP <SERVER_IP> -serverPort <SERVER_PORT> -fullReqExpr q{"GET /GatewayAPI/rest?" + <expression name> + "HTTP/" + http.req.version.major + "." + http.req.version.minor.sub(1) + "\r\nAccept:*/*\r\nHost: <FQDN>\r\n"} -successRule "http.res.status.eq(200)" -scheme -successRule true

set authentication webAuthAction <web auth action name> <server IP address> -serverPort 8080 -fullReqExpr q{"POST /MyPHP/auth.php HTTP/" + http.req.version.major + "." + http.req.version.major + "\r\nAccept:*/*\r\nHost: <server IP address> \r\nContent-Length: 10\r\n\r\n" + <name in the format expected by SMS server>} -scheme http -successRule true
<!--NeedCopy-->

Sample Webauth action configuration

add policy expression otp_exp "\"method=sendMessage&send_to=&msg=OTP i \" + $test[AAA.USER.SESSIONID] + \"for login into secure access  gateway. Valid till EXPIRE_TIME. Do not share the OTP with anyone for security reasons.&userid=#####&password=###=1.0\""

add authentication webAuthAction webAuth_Get -serverIP -serverIP 10.106.168.210 -serverPort 8080 -fullReqExpr q{"GET /GatewayAPI/rest?" + otp_exp + "HTTP/" + http.req.version.major + "." + http.req.version.minor.sub(1) + "\r\nAccept:*/*\r\nHost: <FQDN>\r\n"} -successRule "http.res.status.eq(200)" -scheme -successRule true

set authentication webAuthAction webAuth_POST -serverIP 10.106.168.210 -serverPort 8080 -fullReqExpr q{"POST /MyPHP/auth.php HTTP/" + http.req.version.major + "." + http.req.version.major + "\r\nAccept:*/*\r\nHost: 10.106.168.210 \r\nContent-Length: 10\r\n\r\n" + otp_set} -scheme http -successRule true
<!--NeedCopy-->

Sample first factor configuration

add authentication ldapAction ldap_action -serverIP 1.1.1.1 -serverPort 3268 -authTimeout 30 -ldapBase "dc=nsi-test,dc=com" -ldapBindDn Administrator@nsi-test.com -ldapBindDnPassword freebsd -ldapLoginName samaccountname -groupAttrName memberOf -ssoNameAttribute samaccountname  -Attribute1 mobile -email mail -CloudAttributes DISABLED

add authentication Policy ldap_policy -rule true -action ldap_action
<!--NeedCopy-->

Sample second factor configuration

add authentication policylabel set_otp -loginSchema LSCHEMA_INT
add authentication Policy set_otp -rule true -action test

add authentication policy cascade_noauth -rule true -action NO_AUTHN
add authentication Policy check_otp -rule "$test.valueExists(AAA.USER.SESSIONID)" -action NO_AUTHN

bind authentication policylabel set_otp -policyName set_otp -priority 1 -gotoPriorityExpression NEXT
bind authentication policylabel set_otp -policyName cascade_noauth -priority 2 -gotoPriorityExpression NEXT -nextFactor check_otp

add authentication Policy check_otp -rule "$test.valueExists(AAA.USER.SESSIONID)" -action NO_AUTHN
add authentication policylabel check_otp -loginSchema LSCHEMA_INT
add authentication Policy wpp -rule true -action webAuth_POST
add authentication Policy wpp_cascade_noauth -rule true -action NO_AUTHN

bind authentication policylabel check_otp -policyName wpp -priority 1 -gotoPriorityExpression NEXT
bind authentication policylabel check_otp -policyName wpp_cascade_noauth -priority 2 -gotoPriorityExpression NEXT -nextFactor otp_verify

add authentication Policy otp_verify -rule "AAA.LOGIN.PASSWORD.EQ($test[AAA.USER.SESSIONID])" -action NO_AUTHN
add authentication policylabel otp_verify -loginSchema onlyPassword
bind authentication policylabel otp_verify -policyName otp_verify -priority 1 -gotoPriorityExpression NEXT

add authentication vserver avs SSL 10.106.40.121 443
bind authentication vserver avs -policy ldap_policy  -priority 1 -nextFactor set_otp -gotoPriorityExpression NEXT
<!--NeedCopy-->
SMS two factor authentication using Web authentication