Index: trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp
===================================================================
--- trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp	(revision 5770)
+++ trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp	(revision 5771)
@@ -538,4 +538,5 @@
                  "                            machinefolder default|<folder> |\n"
                  "                            vrdpauthlibrary default|<library> |\n"
+                 "                            websrvauthlibrary default|null|<library> |\n"
                  "                            hwvirtexenabled yes|no\n"
                  "                            loghistorycount <value>\n"
@@ -2821,4 +2822,6 @@
         systemProperties->COMGETTER(RemoteDisplayAuthLibrary)(str.asOutParam());
         RTPrintf("VRDP authentication library: %lS\n", str.raw());
+        systemProperties->COMGETTER(WebServiceAuthLibrary)(str.asOutParam());
+        RTPrintf("Webservice auth. library:    %lS\n", str.raw());
         systemProperties->COMGETTER(HWVirtExEnabled)(&flag);
         RTPrintf("Hardware virt. extensions:   %s\n", flag ? "yes" : "no");
@@ -6520,4 +6523,12 @@
             CHECK_ERROR(systemProperties, COMSETTER(RemoteDisplayAuthLibrary)(Bstr(argv[1])));
     }
+    else if (strcmp(argv[0], "websrvauthlibrary") == 0)
+    {
+        /* reset to default? */
+        if (strcmp(argv[1], "default") == 0)
+            CHECK_ERROR(systemProperties, COMSETTER(WebServiceAuthLibrary)(NULL));
+        else
+            CHECK_ERROR(systemProperties, COMSETTER(WebServiceAuthLibrary)(Bstr(argv[1])));
+    }
     else if (strcmp(argv[0], "hwvirtexenabled") == 0)
     {
Index: trunk/src/VBox/Main/SystemPropertiesImpl.cpp
===================================================================
--- trunk/src/VBox/Main/SystemPropertiesImpl.cpp	(revision 5770)
+++ trunk/src/VBox/Main/SystemPropertiesImpl.cpp	(revision 5771)
@@ -301,4 +301,30 @@
 }
 
+STDMETHODIMP SystemProperties::COMGETTER(WebServiceAuthLibrary) (BSTR *aWebServiceAuthLibrary)
+{
+    if (!aWebServiceAuthLibrary)
+        return E_POINTER;
+
+    AutoLock alock (this);
+    CHECK_READY();
+
+    mWebServiceAuthLibrary.cloneTo (aWebServiceAuthLibrary);
+
+    return S_OK;
+}
+
+STDMETHODIMP SystemProperties::COMSETTER(WebServiceAuthLibrary) (INPTR BSTR aWebServiceAuthLibrary)
+{
+    AutoLock alock (this);
+    CHECK_READY();
+
+    HRESULT rc = setWebServiceAuthLibrary (aWebServiceAuthLibrary);
+    if (FAILED (rc))
+        return rc;
+
+    alock.unlock();
+    return mParent->saveSettings();
+}
+
 STDMETHODIMP SystemProperties::COMGETTER(HWVirtExEnabled) (BOOL *enabled)
 {
@@ -384,4 +410,10 @@
                          bstr.asOutParam());
         rc = setRemoteDisplayAuthLibrary (bstr);
+        if (FAILED (rc))
+            break;
+
+        CFGLDRQueryBSTR (properties, "webServiceAuthLibrary",
+                         bstr.asOutParam());
+        rc = setWebServiceAuthLibrary (bstr);
         if (FAILED (rc))
             break;
@@ -431,4 +463,8 @@
                        mRemoteDisplayAuthLibrary);
 
+    if (mWebServiceAuthLibrary)
+        CFGLDRSetBSTR (properties, "webServiceAuthLibrary",
+                       mWebServiceAuthLibrary);
+
     CFGLDRSetBool (properties, "HWVirtExEnabled", !!mHWVirtExEnabled);
 
@@ -498,2 +534,14 @@
 }
 
+HRESULT SystemProperties::setWebServiceAuthLibrary (const BSTR aPath)
+{
+    Utf8Str path;
+    if (aPath && *aPath)
+        path = aPath;
+    else
+        path = "VRDPAuth";
+
+    mWebServiceAuthLibrary = path;
+
+    return S_OK;
+}
Index: trunk/src/VBox/Main/idl/VirtualBox.xidl
===================================================================
--- trunk/src/VBox/Main/idl/VirtualBox.xidl	(revision 5770)
+++ trunk/src/VBox/Main/idl/VirtualBox.xidl	(revision 5771)
@@ -4537,20 +4537,46 @@
     <attribute name="remoteDisplayAuthLibrary" type="wstring">
       <desc>
-        Path to the library that provides authentication
-        for VRDP clients. The library is used if authentication
-        type is set to "external" in the VM RemoteDisplay
-        configuration.
-
-        The initial value of this property is <tt>VRDPAuth</tt>.
-        That is library called VRDPAuth in one of default library
-        directories. A full path can be used as well.
-
-        <note>
-          The library name does not include the file extension.
-        </note>
+        Library that provides authentication for VRDP clients. The library
+        is used if a virtual machine's authentication type is set to "external"
+        in the VM RemoteDisplay configuration.
+
+        The system library extension (".DLL" or ".so") must be omitted.
+        A full path can be specified; if not, then the library must reside on the
+        system's default library path.
+
+        The default value of this property is <tt>VRDPAuth</tt>. There is a library
+        of that name in one of the default VirtualBox library directories.
+
+        For details about VirtualBox authentication libraries and how to implement
+        them, please refer to the VirtualBox manual.
+
         <note>
           Setting this property to <tt>null</tt> will restore the
           initial value.
         </note>
+      </desc>
+    </attribute>
+
+    <attribute name="webServiceAuthLibrary" type="wstring">
+      <desc>
+        Library that provides authentication for webservice clients. The library
+        is used if a virtual machine's authentication type is set to "external"
+        in the VM RemoteDisplay configuration and will be called from
+        within the <link to="ISessionManager::logon" /> implementation.
+
+        As opposed to <link to="ISystemProperties::remoteDisplayAuthLibrary" />,
+        there is no per-VM setting for this, as the webservice is a global
+        resource (if it is running). Only for this setting (for the webservice),
+        setting this value to a literal "null" string disables authentication,
+        meaning that <link to="ISessionManager::logon" /> will always succeed,
+        no matter what user name and password are supplied.
+
+        The initial value of this property is <tt>VRDPAuth</tt>,
+        meaning that the webservice will use the same authentication
+        library that is used by default for VBoxVRDP (again, see
+        <link to="ISystemProperties::remoteDisplayAuthLibrary" />).
+        The format and calling convetion of authentication libraries
+        is the same for the webservice as it is for VBoxVRDP.
+
       </desc>
     </attribute>
@@ -4562,5 +4588,5 @@
         hardware virtualization extensions such as Intel VT-x and
         AMD SVM by default. This value can be overridden by each VM
-        using their <link to="IMachine::HWVirtExEnabled"/> property.
+        using their <link to="IMachine::HWVirtExEnabled" /> property.
       </desc>
     </attribute>
Index: trunk/src/VBox/Main/include/SystemPropertiesImpl.h
===================================================================
--- trunk/src/VBox/Main/include/SystemPropertiesImpl.h	(revision 5770)
+++ trunk/src/VBox/Main/include/SystemPropertiesImpl.h	(revision 5771)
@@ -68,4 +68,6 @@
     STDMETHOD(COMGETTER(RemoteDisplayAuthLibrary)) (BSTR *aRemoteDisplayAuthLibrary);
     STDMETHOD(COMSETTER(RemoteDisplayAuthLibrary)) (INPTR BSTR aRemoteDisplayAuthLibrary);
+    STDMETHOD(COMGETTER(WebServiceAuthLibrary)) (BSTR *aWebServiceAuthLibrary);
+    STDMETHOD(COMSETTER(WebServiceAuthLibrary)) (INPTR BSTR aWebServiceAuthLibrary);
     STDMETHOD(COMGETTER(HWVirtExEnabled)) (BOOL *enabled);
     STDMETHOD(COMSETTER(HWVirtExEnabled)) (BOOL enabled);
@@ -95,4 +97,5 @@
     HRESULT setDefaultMachineFolder (const BSTR aPath);
     HRESULT setRemoteDisplayAuthLibrary (const BSTR aPath);
+    HRESULT setWebServiceAuthLibrary (const BSTR aPath);
 
     ComObjPtr <VirtualBox, ComWeakRef> mParent;
@@ -103,4 +106,5 @@
     Bstr mDefaultMachineFolderFull;
     Bstr mRemoteDisplayAuthLibrary;
+    Bstr mWebServiceAuthLibrary;
     BOOL mHWVirtExEnabled;
     ULONG mLogHistoryCount;
Index: trunk/src/VBox/Main/xml/VirtualBox-settings-common.xsd
===================================================================
--- trunk/src/VBox/Main/xml/VirtualBox-settings-common.xsd	(revision 5770)
+++ trunk/src/VBox/Main/xml/VirtualBox-settings-common.xsd	(revision 5771)
@@ -320,4 +320,5 @@
   <xsd:attribute name="defaultSavedStateFolder" type="TLocalFile"/>
   <xsd:attribute name="remoteDisplayAuthLibrary" type="TLocalFile"/>
+  <xsd:attribute name="webServiceAuthLibrary" type="TLocalFile"/>
   <xsd:attribute name="HWVirtExEnabled" type="xsd:boolean"/>
   <xsd:attribute name="LogHistoryCount" type="xsd:unsignedInt" default="3"/>
