Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » MobiLink - Server Administration » Synchronization Events

authenticate_file_transfer connection event Next Page

authenticate_parameters connection event

Receives values from the remote that can be used to authenticate beyond a user ID and password. The values can also be used to arbitrarily customize each synchronization.


In the following table, the description provides the SQL data type. If you are writing your script in Java or .NET, you should use the appropriate corresponding data type. See SQL-Java data types and SQL-.NET data types.

In SQL scripts, you can specify event parameters by name or with a question mark, but you cannot mix names and question marks within a script. If you use question marks, the parameters must be in the order shown below and are optional only if no subsequent parameters are specified (for example, you must use parameter 1 if you want to use parameter 2). If you use named parameters, you can specify any subset of the parameters in any order.

Parameter name for SQL scripts




INTEGER. This is an INOUT parameter.


s.remote_idVARCHAR(128). The MobiLink remote ID. You can only reference the remote ID if you are using named parameters.Not applicable


VARCHAR(128). The MobiLink user name.


a.N (one or more)

VARCHAR(128). For example, named parameters could be a.1 a.2.


Parameter Description

You can send strings (or parameters in the form of strings) from both SQL Anywhere and UltraLite clients. This allows you to have authentication beyond a user ID and password. It also means that you can customize your synchronization based on the value of parameters, and do this in a pre-synchronization phase, during authentication.

The MobiLink server executes this event upon starting each synchronization. It is executed in the same transaction as the authenticate_user event.

You can use this event to replace the built-in MobiLink authentication mechanism with a custom mechanism. You may want to call into the authentication mechanism of your DBMS, or you may want to implement features not present in the MobiLink built-in mechanism.

If the authenticate_user or authenticate_user_hashed scripts are invoked and return an error, this event is not called.

SQL scripts for the authenticate_parameters event must be implemented as stored procedures.

See also

For UltraLite remote databases, pass the parameters using the num_auth_parms and auth_parms fields in the ul_synch_info struct. num_auth_parms is a count of the number of parameters, from 0 to 255. auth_parms is a pointer to an array of strings. To prevent the strings from being viewed as plain text, the strings are sent in the same way as passwords. If num_auth_parms is 0, set auth_parms to NULL. Following is an example of passing parameters in UltraLite:

ul_char * Params[ 3 ] = { UL_TEXT( "param1" ), 
   UL_TEXT( "param2" ), UL_TEXT( "param3" ) };

info.num_auth_parms = 3;
info.auth_parms = Params;

For SQL Anywhere remote databases, you pass parameters using the dbmlsync -ap option, in a comma-separated list. For example, the following command line passes three parameters:

dbmlsync -ap "param1,param2,param3"

In this example, the authenticate_parameters script could be:

{CALL my_auth_parm( {
   a.3 } ) }