Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Macro OpenWithBasicSignon

Status
Not open for further replies.

gasman009

Vendor
Jun 12, 2002
51
0
0
US
Has anyone used the OpenWithBasicSignon Method to access a namespace on an LAE?

Documentation:
OpenWithBasicSignon Method - Opens an existing namespace on a directory server or local authentication export file by using a basic signon.

Syntax:
AuthenticatorDocuments.OpenWithBasicSignon Namespace, Signon, [Password],
[UserClassName]

Here's a sample of my code:
'-----------------------------------------------------------
Sub Main()
Dim objAuthApp as Object
Dim objAuthDoc as Object
Dim objLAEConfig as Object
Dim sLAEPath as String
Dim objUserClass() as Object 'Object array for Access Manager UserClasses
'-----------------------------------------------------------
'In Use: used for directly writing to the LAE file in sLAEPath.
'Script is the namespace
sLAEPath = "E:\Cognos\cer3\bin\Backup\Default.lae"
Set objAuthApp = CreateObject("Authenticator2.Application")
Set objLAEConfig = objAuthApp.LAEConfigurations.Add(sLAEPath)
Set objAuthDoc = objAuthApp.Documents.OpenWithBasicSignon ("Script", "administrator", "password", 0)

'Not In Use: used for directly writing to the Directory Server.
'Set objAuthApp = CreateObject("Authenticator2.Application")
'Set objAuthDoc = objAuthApp.Documents.OpenWithBasicSignon ("Default", "administrator", "password", 0

'ReDim's objUserClass arrays to number of UserClasses
ReDim objUserClass(6) as Object
Set objUserClass(0) = objAuthDoc.RootUserClass

Set objAuthDoc = Nothing
Set objAuthApp = Nothing
Set objLAEConfig = Nothing

End Sub
'-----------------------------------------------------------

Problem:
I don't think I am accessing the namespace in the LAE correctly because the following code fails:
Set objUserClass(0) = objAuthDoc.RootUserClass
(If you use the commented-out "not in use" code to access the directory server, the line above works!)

Thanks for reading this...
 
Do you have a namespace in your Access Manager named "Script". If not, objAuthDoc will be assigned a value of "Nothing" and therefor attempts to reference this object will fail.
 
I do. And it does assign it a value of Nothing when I run the script. Thanks for the reply. I didn;t think anyone was reading it...

So, I found the way to do it. Someone gave me the tip of settting the default Directory Source (which I didn't think was a great workaround).

Here's a snipet of the code if you're interested:

Set objAuthApp = CreateObject("Authenticator2.Application")
Set objLAEConfig = objAuthApp.LAEConfigurations.Add(sLAEPath)
Set objDSConfig = objAuthApp.DSConfigurations.Add(DSHostName,DSPort,DSBaseDN,DSTimeout)

'This line determines which is the default. The default must be toggled if you want to work on both DS and LAE.
objDSConfig.DefaultSecuritySource = True
'objLAEConfig.DefaultSecuritySource = True

Set objAuthDoc = objAuthApp.Documents.OpenWithBasicSignon ("Test", "administrator", "password", 0)


The following are variables:
Dim DSHostName as String
Dim DSPort as Integer
Dim DSBaseDN as String
Dim DSTimeout as Integer

Hope that helps anyone else out there... and thanks again for the response.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top