|
LoginKeys |
Top Previous Next |
|
The primary method of authentication in ObjAcct is to submit CompanyID, UserID and Password to the GetLoginKey()web method. This will return a LoginKey which can be used as a valid credential that you pass back to the web services in the SOAP header using the PopulateObjAcctSoapHeader() function each time you call an ObjAcct Framework API function.
The following code performs a login by calling the GetLoginKey() function using existing user credentials and then stores the LoginKey that is returned in Session.
' Get an instance of the LoginWebService. Dim ws As New WebServices.LoginWebService()
Dim ds As DataSet
' Get a loginKey from the web service. ds = ws.GetLoginKey("demo", "smith", "abc123", _ "", "", "", "", "", "", ReturnType.Standard)
' Check for errors and invalid logins. If StdLib.GetErrorNumber(ds) >= 0 Then Response.Write(StdLib.GetErrorMessage(ds)) End If
' Store the LoginKey in Session (or ViewState). Session("LoginKey") = ds.Tables("Login").Rows(0).Item("LoginKey")
See: GetLoginKey(), PopulateObjAcctSoapHeader(), SetCredentials()
|