Login Method

Logs the specified user with either pair: username and password, or API key and API secret on to the site administration application.
In SSO mode, you can only use this method with API key and API secret to log in. Alternatively, you can log in by using the LoginWithApiKey method.
Note: This method supports login with API key and API secret in ALM 15.5.1 and later. In earlier versions, it only supports login with username and password.
Visual Basic
Public Sub Login( _
   ByVal ServerURL As String, _
   ByVal UserName As String, _
   ByVal password As String _


Public Sub Login( _
   ByVal ServerURL As String, _
   ByVal apiKey As String, _
   ByVal apiKeySecret As String _
The URL in the format http://<server name>[:<port>]/qcbin.
The user name defined in the ALM database.
The user's password.
The API Key Client ID that you obtained from the ALM customer administrator to use for API key authentication.
The API Key Secret that belongs to the Client ID you passed.
Private Function LogOn(URL As String, UserName As String, pwd As String) As Boolean
On Error GoTo LogOnErr
    ' Get administrator connection
    If m_SAClient Is Nothing Then Set m_SAClient = New SAapi
    'Note: Release this connection before program exits, for example,
    '  in Form_Unload event
    '    Set m_SAClient = Nothing
    'Log on
    m_SAClient.Login URL, UserName, pwd
    LogOn = PASS
Exit Function
    LogOn = FAIL
    MsgBox "Logon Failed" + err.Description
End Function
See Also