I am attempting to use SECTokenValidate from the notes C API. Here is my code.
Under Declarations
Type TIMEDATE
Innards(1) As Long 'DWORD
End Type
Declare Function SECTokenValidate Lib “nnotes.dll” (Byval ServerName As String, Byval OrgName As String, Byval ConfigName As String, _
Byval tokenData As String, Byval retUsername As String, retCreation As TIMEDATE, retExpiration As TIMEDATE, Byval dwReserved As Long, Byval vpReserved As Long) As Integer
And then the call
Dim retUsername As String*256
Dim retCreation As TIMEDATE
Dim retExpiration As TIMEDATE
Dim vpReserved As Integer
Msgbox getAPIError(SECTokenValidate ("serverName", "orgName", "configName", "string taken from cookie", _
retUsername, retCreation, retExpiration,0,0))
GetAPIError returns that there is no error. The code is below
Function GetAPIError (errorCode As Integer) As String
Dim errorString As String*256
Dim returnErrorString As String
Dim resultStringLength As Long
Dim errorCodeTranslated As Integer
'** mask off the top 2 bits of the errorCode that was returned; this is
'** what the ERR macro in the API does
errorCodeTranslated = (errorCode And ERR_MASK)
'** get the error code translation using the OSLoadString API function
resultStringLength = OSLoadString(0, errorCodeTranslated, errorString, Len(errorString) - 1)
'** strip off the null-termination on the string before you return it
If (Instr(errorString, Chr(0)) > 0) Then
returnErrorString = Left$(errorString, Instr(errorString, Chr(0)) - 1)
Else
returnErrorString = errorString
End If
GetAPIError = returnErrorString
End Function
The problem with the function is that it returns nothing in the msgbox. I am 95% positive I have the proper orgName and configName, and I have tried using every single one of our server names.
The token data I am passing is the value I copied out of the cookie after I authenticated in the browser. I am not sure if that is what I need or not.
Does anyone have experience with this that could possibly show me where my error is?