Authentication question

SuperiorRob

New member
Joined
Aug 12, 2005
Messages
2
Location
Orlando, FL
I am new to programming and am trying to use the DirectAdmin API to create new user accounts. I am able to build my form data and send it to CMD_ACCOUNT_USER on the DA server. When I do, though, I get a login prompt. If I am testing with a GET and enter the reseller login information on the prompt the user gets created properly, so I know my form data is correct.

I know this is probably a very silly question, but I am so new to it.

How do I send the required basic web authentication to the DA server so I can bypass the login prompt?

I am using a form from an ASP page on a Microsoft server using VBScript.

Thanks in advance for your help.
 
I figured out how to do it using the ServerXMLHTTP object. I had to inject the Authorization line into the header using the setRequestHeader method with the Base64 encoded username:password.

See the sample below:

set objHttp = Server.CreateObject("Msxml2.ServerXMLHTTP")
' set objHttp = Server.CreateObject("Msxml2.ServerXMLHTTP.4.0")
'set objHttp = Server.CreateObject("Microsoft.XMLHTTP")
objHttp.open "POST", strLine, false
objHttp.setRequestHeader "Content-type", "text/xml"
objHttp.setRequestHeader "Authorization", "Basic dXNlcm5hbWU6cGFzc3dvcmQ="
objHttp.Send

Thanks to anyone that was looking for the answer.
 
Back
Top