Login Method

Description
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.
Syntax
Visual Basic
Public Sub Login( _
   ByVal ServerURL As String, _
   ByVal UserName As String, _
   ByVal password As String _
) 

Or,

Public Sub Login( _
   ByVal ServerURL As String, _
   ByVal apiKey As String, _
   ByVal apiKeySecret As String _
) 
Parameters
ServerURL
The URL in the format http://<server name>[:<port>]/qcbin.
UserName
The user name defined in the ALM database.
password
The user's password.
apiKey
The API Key Client ID that you obtained from the ALM customer administrator to use for API key authentication.
apiSecret
The API Key Secret that belongs to the Client ID you passed.
Example
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
LogOnErr:
    LogOn = FAIL
    MsgBox "Logon Failed" + err.Description
    
End Function
See Also