Creating person doc in secondary directory

Hi

I am creating person documents in a secondary directory for web access to a database hosted in a DMZ for our site. I’m able to create the person document and can view it in the directory. However, I’m unable to get the user to login using the created account. I get an “user not authorised” error.

If i open the document in the directory and set the password manually and save the document, the user is able to log in.

I have downloaded the registration database from the sandbox and modified my code to ‘mimic’ the code use there. However, still no luck. I have searched this forum and seen reference to setting various fields. e.g. the $Securepassword, hashing the password, not hashing, doing a compute with form. I have tried variations of all these, but still the created person is unable to login via the web site until i manually set the password field in the person document.

Here is the code i’m using. some lines have been commented out to show what i’ve tried.

Set dirDoc = dirDB.CreateDocument		

'Setting the database property DelayUpdates to false

'forces Notes to commit the NAB entry in real time.

dirDB.DelayUpdates = False 



Call dirDoc.ReplaceItemValue( "Form", "Person" )

Call dirDoc.ReplaceItemValue( "Type", "Person" )

Call dirDoc.ReplaceItemValue( "LastName", Trim( pDoc.payCustNo(0) ) )

Call dirDoc.ReplaceItemValue( "ShortName", Trim( pDoc.payCustNo(0) ) )

Call dirDoc.ReplaceItemValue( "FullName", Trim( pDoc.payCustNo(0) ) + "/Webuser" )

’ dirDoc.~$SecurePassword = “1”

pwdString = PasswordGenerator	

’ Call dirDoc.ReplaceItemValue( “HTTPPassword” ,session.Password( pwdString )

Call dirDoc.ReplaceItemValue( "HTTPPassword" , pwdString )

Call dirDoc.ComputeWithForm( False, False )

Call dirDoc.Save( True, True )

i’m sure someone has done this before and got it to work. am i just missing a simple step somewhere???

thanks in advance

andyG

i’ve also tried refreshing views:

'complete realtime update by refreshing $FullName and $ServerAccess views.

Dim nabFullNameView As NotesView

Dim nabServerAccessView As NotesView



Set nabFullNameView = dirDB.GetView("($LDAPCN)")

Set nabServerAccessView = dirDB.GetView("($ServerAccess)")



Call nabFullNameView.Refresh

Call nabServerAccessView.Refresh

'Closing the session commits person document to NAB

Call session.close

Subject: creating person doc in secondary directory

I had this same problem was driving me crazy until I tried…

Call dirDoc.ReplaceItemValue( “FullName”, “CN=” +Trim( pDoc.payCustNo(0) ) + “/O=Webuser” )

Then it worked like a charm.

Leo

Subject: RE: creating person doc in secondary directory

Visiting old posts, and yes, i needed to pass a canonical name to the backend document:

Dim nam As NotesName

Set nam = session.CreateName( {CN=} + Trim( pDoc.payCustNo(0) ) + {/O=Webuser})

Call dirDoc.ReplaceItemValue( “FullName”, nam.canonical )