Skip to main content
rmreddy
Staff
Staff
Oct 5, 2026 8:39 AM UTC

Technical Tip: Unable to receive authentication code via SMS

Description

This article describes the procedure for sending an authentication code through SMS when the user reports that the authentication code message was not received.

Scope

FortiAuthenticator.

Solution

  • If the SMS gateway message template is configured with the variable {{:token_code}}, but users receive a message without the OTP code, such as:


"Your OTP login is . Valid for 3 minutes. Do not share the OTP."


This indicates that the token code placeholder is not being substituted with the generated authentication code, resulting in a blank value in the SMS content.

  • If the OTP code is missing when using the {{:token_code}} variable, modify the SMS gateway message template to:


Your OTP login is {{:message}}. Valid for 3 minutes. Do not share the OTP.


After updating the template, the authentication code will be included correctly in the SMS message delivered to the user.

  • Configure the SMS gateway replacement message as shown below:


Plain Text
Your OTP login is {{:token_code}}. Valid for 3 minutes. Do not share the OTP.
Show more lines


The {{:token_code}} placeholder will be replaced with the generated OTP, ensuring that users receive the authentication code in the SMS message.

  • Modify the replacement message to {{:token_code}}.

Navigate to System -> Administration -> Replacement messages.

f9efbdbb.png


  • After changing the replacement message variable to {{:message}}, the authentication code is populated correctly in the SMS message.


Example configuration:


Plain Text
Your OTP login is {{:message}}. Valid for 3 minutes. Do not share the OTP.
Show more lines


Result:


Plain Text
Your OTP login is 123456. Valid for 3 minutes. Do not share the OTP.
Show more lines


The {{:message}} variable is replaced with the generated OTP, allowing the user to receive the authentication code in the SMS message.

  • When using the Test Settings option, the SMS message may be received as:


Plain Text
Your OTP login is FAC_FQDN. Valid for 3 minutes. Do not share the OTP.

 

  •  This behavior is expected because FortiAuthenticator does not generate an actual token code during the test. Instead, it sends a test message in which the {{:message}} variable is replaced with the FortiAuthenticator FQDN (FAC_FQDN) to verify SMS gateway connectivity and message delivery.


Note: When using the Test Settings option, the test message will not contain an OTP code because FortiAuthenticator does not generate a token during the test process.


As a result, the message will contain the test value instead of an actual authentication code. To verify OTP delivery with a generated token code, perform a real authentication request rather than using Test Settings.


Related documents:

    Risk and Resilience in the Age of AI. An OT Thought Leadership Summit for Houston's Critical Infrastructure Leaders. Date: Thursday, December 3, 2026. Time: 8:30 am - 1:30 pm (CT). Location: The Westin Houston, Memorial City | 945 Gessner Road, Houston, TX 77024