2008年2月20日星期三

authenticate_parameters connection event in ASA10(SQL Anywhere10.0.1)

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.

Parameters

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

Description

Order

s.authentication_status

INTEGER. This is an INOUT parameter.

1

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

s.username

VARCHAR(128). The MobiLink user name.

2

a.N (one or more)

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

3...

Parameter Description
  • authentication_status  The authentication_status parameter is required. It indicates the overall success of the authentication, and can be set to one of the following values:

    Returned Value

    authentication_status

    Description

    V <= 1999

    1000

    Authentication succeeded.

    1999 < V <= 2999

    2000

    Authentication succeeded, but password expiring soon.

    2999 < V <= 3999

    3000

    Authentication failed as password has expired.

    3999 < V <= 4999

    4000

    Authentication failed.

    4999 < V <= 5999

    5000

    Authentication failed as user is already synchronizing.

    5999 < V

    4000

    If the returned value is greater than 5999, MobiLink interprets it as a returned value of 4000 (authentication failed).

  • username  This parameter is the MobiLink user name. VARCHAR(128).

  • remote_ID   The MobiLink remote ID. You can only reference the remote ID if you are using named parameters.

    See Using remote IDs and MobiLink user names in scripts.

  • remote_parameters  The number of remote parameters must match the number expected or an error results. An error also occurs if parameters are sent from the client and there is no script for this event.

Remarks

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.

没有评论:

发表评论