OpenMetabase

Syntax

OpenMetabaseResult OpenMetabase(MbDef tDef, UserCreds tCreds, [OpenMetabaseArg tArg])

Parameters

tDef. Description of the repository, the user is connecting to.

tCreds. User credentials used for connection.

tArg. Connection parameters.

Description

The OpenMetabase operation connects to the repository and returns the moniker of the repository connection.

Comments

The operation executes the following actions:

Connection to a repository can be established in various ways. To connect to a repository, specify the repository information and user authentication parameters. For specifying a repository to connect, the following variants are available:

To authenticate the user, use the following methods (a more detailed description is provided below):

Authentication parameters are specified in the tCreds field.

The operation results in the following objects:

NOTE. Session parameters are stored in the BI server memory or at the state server if configuration defined a group of StateServer settings. If the StateServer group of settings is defined, the state server is disconnected, the session identifier is not generated.

The obtained moniker is further used in the following cases:

The sessKey session key can be used, for example, to work with access protocol to get a list of operations executed in the session.

The sessCookie identifier, unlike the moniker, is not used to work with the repository, and is used only to identify existing server sessions. If the obtained identifier is saved and on a new connection is further specified as a value of the tArg.sessCookie field, BI server checks if a session with the same identifier exists. If such a session exists, it is checked if it can be reused. The necessary conditions for reuse of the session:

Authentication Methods

Direct Indication of Credentials

The credentials are specified in the tCreds.user and tCreds.pass fields.

Connection Using Digital Signature

To connect to repository using a digital signature, prepare the repository in the following way:

NOTE. If the BI server is deployed on the IIS web server, the BI server pool must be started using credentials of the same user who started the PP.Util.exe utility.

Before connection execute the GetVerifierCode operation to get the data block the client must sign with the digital signature. In the tCreds.verifier.signature field specify the signed data, and in the tCreds.verifier.cookie field specify the random number that will also be obtained as the result of executing the GetVerifierCode operation. In the tCreds.verifier.user field specify the user who connects to the repository. This user may be not available in the repository DBMS or in the security manager.

NOTE. If the specified user does not exist anywhere, it is created in the security manager of the repository. If the tCreds.verifier.role field was defined, the user is included into the specified group and granted respective permissions. If this field is not defined, the user is included into the Built-in Users Group. If required, permissions of the created user can be edited with the SetMbSec operation.

In the tCreds.verifier.mbUser field specify the user whose credentials will be used for actual connection to the repository database. This user must exist in the repository and have permissions to enter the repository. Also, in the tCreds.verifier.certificate field specify identifier of the certificate to be used to verify the digital signature. This certificate must be saved to the repository as described above. An empty string is set as the value of the tCreds.pass field, and this field is not used when connecting to the repository using a digital signature.

Integrated Domain Authentication

To use integrated domain user authentication, do not specify the tCreds.user field, and in the tCreds.pass field specify empty value. In this case the current operating system user credentials are sent for connection.

Monitoring Events

The handler of custom events that will handle actions executed from web service can be installed in the repository. To do it, set the following settings:

  1. Set the IMetabaseDefinition.CheckCustomEvents property to True.

  2. Set the special object MetabaseSpecialObject.MetabaseCustomEvents for repository, as the object specify the unit containing the IMetabaseCustomEvents.

On executing the OpenMetabase operation the following algorithm will be executed:

  1. If IMetabaseDefinition.CheckCustomEvents = False, then the connection is open according to sent credentials and returns the connection moniker.

  2. If IMetabaseDefinition.CheckCustomEvents = True, then the connection is open with credentials that must be saved by thePP.Util. If there are no saved data, then exclusive situation is generated.

  3. The special object that must be set in repository is launched. If it is not set or there is no implementation of the IMetabaseCustomEvents interface in it, the exclusive situation is generated.

  4. To the OnBeforeLogon event the credentials that were sent to the OpenMetabase operation are sent. Next, according to the application logic, any actions can be executed in the event handler. The resulting connection must be set in theResultMetabase property of the event argument, the moniker of the connection will be returned as the operation result. If for any reasons in the vent handler theAllowLogon property of the event argument was set to False, then the exclusive situation will generated as the operation result.

Example

Various methods of using the operation are given in the following examples:

Example name
Connecting to Repository with Direct Passing of Credentials
Connecting to Repository Using Digital Signature
Connecting to Repository Using Integrated Domain Authentication

See also:

Common Operations