ISecurityPackage.CreateCredentials

Syntax

CreateCredentials(Authentication: AuthenticationMode): ICredentials;

Parameters

Authentication. Authentication type that is used.

Description

The CreateCredentials method creates repository credentials with the specified authentication type.

Example

Sub Main;
Var
    Package: ISecurityPackage;
    OracleSPLD: IPrimaryOracleSPLD;
    Creds: IPasswordCredentials;
    Connection: ISecurityConnection;
    ColCur: IDalColumns;
    Field: IDalCursorField;
Begin
    Package := New StandardSecurityPackage.Create;
    OracleSPLD := Package.CreateLogonData("ORCL"As IPrimaryOracleSPLD;
    OracleSPLD.Scheme := "Test_Schema_ORCL";
    OracleSPLD.Server := "Test_ORCL";
    Creds := Package.CreateCredentials(AuthenticationMode.Password) As IPasswordCredentials;
    Creds.UserName := "TestUser";
    Creds.Password := "TestUser";
    Connection := Package.PerformLogon(True, OracleSPLD, Creds);
    ColCur := Connection.Columns("Table_1");
    While Not ColCur.Eof Do
        For Each Field In ColCur.Fields Do
            Debug.WriteLine(Field.Name + " " + Field.Value);
        End For;
        Debug.WriteLine("");
        ColCur.Next;
    End While;
    ColCur.Close;
End Sub Main;

After executing the example a new connection to the Test_Schema_ORCL schema located on the Test_ORCL server is established with the specified credentials. System information about the Table_1 table, if there is such in this schema, is obtained and displayed in the development environment console.

See also:

ISecurityPackage