Page 1 of 1
How to set username and password in VBox websrv
Posted: 4. Dec 2008, 12:38
by liupengjian
I am writing a programe to connect to VBox server, and I am using VBox's webserver by runing vboxwebsrv.exe.
By setting: VBoxManage setproperty websrvauthlibrary null
can login the web server without username and password.
however, I need some kind of authentication, so I need to set a user name and password. Any one knows how to set that?
(seems need to do with WSDL, but I am not sure how to do)
Posted: 4. Dec 2008, 17:02
by TerryE
This is all described in the SDK documentation.
Posted: 5. Dec 2008, 03:36
by liupengjian
I have read the SDK doc, but still not quite sure what to do exactly.
Can you give some more details?
very urgent. thanks
Posted: 5. Dec 2008, 04:07
by liupengjian
ok I got it. the user name and password for vbox authentication is same login name and password for the host which the vbox is installed.
so no need to set a user name and password in any files in vbox.
Posted: 5. Dec 2008, 10:18
by liupengjian
Sorry, still have problem here, it seems any username and password will pass the authentication.
Code: Select all
VBoxManage setproperty websrvauthlibrary default
vboxwebsrv -t 1000
and in VBox API I called:
Code: Select all
vbox = VirtualBox.connect(HostIP, "Admin", "pswd"); //admin, and pswd are my system username and password
but it seems all string can pass the authentication.
I saw in SDK doc:
Code: Select all
#include "VRDPAuth.h"
/**
* Authentication library entry point. Decides whether to allow
* a client connection.
*
* Parameters:
*
* pUuid Pointer to the UUID of the virtual machine
* which the client connected to.
* guestJudgement Result of the guest authentication.
* szUser User name passed in by the client (UTF8).
* szPassword Password passed in by the client (UTF8).
* szDomain Domain passed in by the client (UTF8).
*
* Return code:
*
* VRDPAuthAccessDenied Client access has been denied.
* VRDPAuthAccessGranted Client has the right to use the
* virtual machine.
* VRDPAuthDelegateToGuest Guest operating system must
* authenticate the client and the
* library must be called again with
* the result of the guest
* authentication.
*/
VRDPAuthResult VRDPAUTHCALL VRDPAuth(PVRDPAUTHUUID pUuid,
VRDPAuthGuestJudgement guestJudgement,
const char *szUser,
const char *szPassword
const char *szDomain)
{
/* process request against your authentication source of choice */
return VRDPAuthAccessGranted;
}
If I want to set up an user name and password,do I have to change the code above? How do I make sure of this code?
Code: Select all
VBoxManage setproperty websrvauthlibrary default|null|<library>
what is <library>? what should I put here for library?
Thanks , very urgent.