SECTokenValidate

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?

Subject: SECTokenValidate must be executed on the server, it is not a client call

Hi,The SSO APIs sometimes include a parameter to specify a servername, however the server information is always ignored. The only way to call this particular API is on the server itself, which is capable of doing the validation given the server’s access to encrypted information in Domino directory.

hope this helps,

Jane Marcus

jmarcus@us.ibm.com

Subject: Thank you!

Thank you so much! It worked first try on the server.

Now what I am attempting to do is run SSO to another system on our network that does not have Domino installed.

Does this mean I will be unable to do this unless Domino is installed on there?

Subject: Any help?

I’ve looked all over for any kind of example for this and I’ve turned up nothing.