Messages Proxy
Messages Proxy is a web application that runs on IIS. Messages Proxy provides a Web API for sending OTPs by running external modules (scripts, binary executable modules). Unlike SMS Proxy, Messages Proxy does not connect to an SMPP gateway; it only runs scripts (any executable file).
System requirements
- Windows Server 2012 R2 and higher
- Internet Information Services 7.5 and higher with the following modules:
- Web server
- Static Content Compression
- HTTP Errors
- HTTP Redirection
- Windows Authentication
- WebDAV Publishing
- ASP.NET
- ASP
- ISAPI Extensions
- ISAPI Filters
- IIS Management Console
- IIS Management Scripts and Tools
- Management Service
Preconfiguration
- Install the IIS role on the server where you plan to install Messages Proxy, in one of the following ways:
- Open Server Manager, select Local Server, and on the Manage tab, click Add Roles and Features.
- Run the
\Misc\IISScripts\Axidian.Main.IIS.Install.MSServer.ps1script.
- Install .NET 6 by running
dotnet-hosting-6.0.10-win.exefrom theAxidian Access <version number>/Axidian Idpfolder of the distribution.
Installation
- Run the installation file located at
Axidian Access <version number>/Axidian Messages Proxy/<version number>and follow the steps of the installation wizard. - After the installation is complete, a system restart may be required. If the installation wizard prompts you to restart the system, confirm this action.
- To remove or restore the product, open the Control panel menu and use the standard procedure for the supported operating systems.
Prepare the certificates for Messages Proxy and Core Server
During the Messages Proxy module installation, the SSL certificate requirement is enabled by default, which in turn requires HTTPS configuration.
On the Messages Proxy server (server)
To request a certificate from the Windows domain certification authority:
Open the certificate manager certlm.msc.
In the Personal folder, right-click Certificates and select All Tasks → Request New Certificate.
In the Certificate Enrollment window, click Next → Next, select the web server certificate template you created earlier, and click More information is required to enroll for this certificate.
In the Certificate Properties window that appears, add the following values and click OK:
- Subject name: in the Type field, specify Common name, and in the Value field, specify the full computer name (Srv01.axidian.local) or the short one (Srv01).
- Alternative name: in the Type field, specify DNS, and in the Value field, specify the full computer name (Srv01.axidian.local).
Run IIS Manager.
Go to Srv01(AXIDIAN\Admin-axidian) → Sites → Default Web Site and in the Actions section, click Bindings.
Select the line with https 443 and click Edit. In the Edit Site Binding window that opens, select your certificate in the SSL certificate drop-down list and click OK.
Select the line with http 80 and click Remove.
Now you can open the IIS start page in a browser at https://Srv01.axidian.local/ (the connection is secure).
On Core Server (client)
Generate a client authentication certificate. You can use the Computer template in the Windows domain certification authority as a basis. To do this, on the machine with Core Server:
Open the certificate manager certlm.msc.
In the Personal folder, right-click Certificates and select All Tasks → Request New Certificate.
In the Certificate Enrollment window, click Next → Next and select the Computer certificate template you created earlier.
Edit the configuration file
On the Messages Proxy server, open the
app-settings.Production.jsonconfiguration file from theC:\inetpub\wwwroot\am\proxies\messagesfolder.In the
Scriptsfield, specify the following values:Path— the path to the program that runs the scriptArguments— the script startup parameters, including the path to the scriptTimeout— the time after which Messages Proxy returns an error if the script has not been executed. The default value is 00:00:20 (20 seconds)
InformationYou can add more than one script to the
Scriptsfield. To do this, specify several blocks with the parameters for each script, separated by commas. You can also define the script startup order — sequential (Sequential) or simultaneous (Parallel). If this parameter is not defined, the default valueSequentialis used.In the
LoggingPermissionsfield, specify the parameters that define the information to be logged. The possible parameters are:Source— the message senderDestination— the message recipientError— the script execution errorsOutput— the messages generated during the script executionNone(the default value) — the values of all logged fields are hiddenAll— the values of all logged fields are shown
For example, if the
Sourceparameter is specified inLoggingPermissions, the message sender is logged (not hidden). All the other parameters are hidden and replaced with ****. The logs are located in theC:\inetpub\wwwroot\am\proxies\messages\Logs\<folder with the date>folder.The
Publicationfield includes the optionalDefaultSourceparameter that contains the default SMS sender name.Optionally, you can configure the parameter that enables Swagger. In the
Documentationfield, set theEnabledparameter totrue. Swagger is then available at/am/proxies/messages/documentation.In the
Authentication": { "Certificate": { "Thumbprint": "" } }field, specify the thumbprint of the (client) certificate that the provider (SMS or Storage SMS) can be authenticated with in Messages Proxy to send messages. You can use several certificates from several clients; in this case the field is named"Thumbprints".
An example of the configuration file
{
"MessagesProxy": {
"Scripts": [
{
"Path": "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
"Arguments":
[
"/c", "C:\\inetpub\\wwwroot\\am\\proxies\\messages\\script.bat",
"{0:Source}",
"{0:Content}",
"{0:Phone}",
"{0:RawObjectId}",
"{0:Sid}",
"{0:DistinguishedName}",
"{0:PrincipalName}",
"{0:SamCompatibleName}",
"{0:Email}",
"{0:CustomParameter}"
],
"Timeout": "00:00:10"
}
],
"LoggingPermissions": "Source"
},
"Publication": {
"DefaultSource": "Axidian sender"
},
"Documentation": {
"Enabled": false
},
"Debug": {
"ExceptionResponsesEnabled": false
},
"Authentication": {
"Certificate": {
"Thumbprint": "124b3c62f4da3ce8bb271dc4990e354d118daa0g"
}
},
"ReverseProxyIntegration": {
"BasePath": "/am/proxies/messages"
},
"Localization": {
"DefaultCulture": "en-US"
}
}
Script
The script file reads the parameters passed from Messages Proxy. The parameters are written to the C:\distr\ps.json file (the fileName parameter from the PowerShell script example).
When Messages Proxy is used through an SMS provider, the OTP is passed in the Content parameter.
An example of a PowerShell script
$body = @(
@{
Source = $args[0]
Content = $args[1]
Phone = $args[2]
RawObjectId = $args[3]
Sid = $args[4]
DistinguishedName = $args[5]
PrincipalName = $args[6]
SamCompatibleName = $args[7]
Email = $args[8]
CustomParameter = "I am PS"
}
)
$body | ConvertTo-Json | Out-File "C:\distr\ps.json"
Invoke-WebRequest -Method Post -Uri 'http://Srv01.axidian.local:82/api/sms' -Body ($body|ConvertTo-Json) -ContentType 'application/json'
Start-Sleep -Seconds 5
Configure SMS OTP / Storage SMS OTP Provider
Use group policies to configure SMS OTP Provider or Storage SMS OTP Provider to send OTPs through Messages Proxy. Before you configure the group policies, add the Axidian Access policy templates to the administrative template list. The policy template files are included in the Messages Proxy distribution and are located in the Misc folder.
Select the connection type
- With GPO
- In the registry
The Select the provider connection type policy applies to the Axidian Access servers and is designed to select the connection type of Core Server (through SMS OTP Provider or Storage SMS OTP Provider) to the SMS gateway.
Open the Select the provider connection type policy. The policy is located at Administrative Templates → Axidian-ID → Id Providers → SMS OTP.
Set the policy value to Enabled.
In the parameters, select the Messages proxy option for Messages Proxy.
- Open the registry editor on the Axidian Access server.
- Open the
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Axidian-ID\BSPs\SMSOTPsection. - Create the SmsSenderType parameter of the DWORD type with the value 6.
Connection type settings
- With GPO
- In the registry
The Messages proxy settings policy applies to the Axidian Access servers and defines the connection type settings.
Open the Messages proxy settings policy. The policy is located at Administrative Templates → Axidian-ID → Id Providers → SMS OTP.
Set the policy value to Enabled.
Define the following parameters:
- URL — the server connection address
- Sender — the sender name displayed when the message is received
- Additional text before the OTP — an arbitrary message text that precedes the one-time password
- Client certificate thumbprint — the provider certificate specified in the Messages Proxy
app-settings.Production.jsonconfiguration file (theAuthentication": {"Certificate": { "Thumbprint": "" } }field) - Server certificate thumbprint — the Messages Proxy certificate for working through HTTPS (configured in IIS)
- Open the registry editor on the Axidian Access server.
- Open the
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Axidian-ID\BSPs\SMSOTP\MessagesProxysection. - Create the following parameters:
- ServerUrl — the server connection address
- From (REG_SZ) — the sender name displayed when the message is received
- messageOTP (REG_SZ) — an arbitrary message text that precedes the one-time password
- ClientCertificateThumbprint (REG_SZ) — the provider certificate specified in the Messages Proxy
app-settings.Production.jsonconfiguration file (theAuthentication": { "Certificate": { "Thumbprint": "" } }field) - ServerCertificateThumbprint (REG_SZ) — the Messages Proxy certificate for working through HTTPS (configured in IIS)