In MobiLink scripts, authentication parameters are named parameters that are prefaced with the letter a, such as {ml a.1}. The parameters must be numbers starting at 1, with a limit of 255. The values are sent up from MobiLink clients.
When used in the authenticate_* scripts, authentication parameters pass authentication information.
Authentication parameters can be used in all other events (except begin_connection and end_connection) to pass information from MobiLink clients. This technique is a convenient way to do something that you could otherwise do by creating and populating a table.
On SQL Anywhere remotes, you pass the information with the dbmlsync -ap option. On UltraLite remotes, you pass the information with auth_parms and num_auth_parms.
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 authentication 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" |
On the server, you reference the scripts in the order in which they were sent up. In this example, the authenticate_parameters script could be:
CALL my_auth_parm ( {ml s.authentication_status}, {ml s.remote_id}, {ml s.username}, {ml a.1}, {ml a.2}, {ml a.3} ) |
Send feedback about this page via email or DocCommentXchange | Copyright © 2008, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.0 |