Index: OpenSceneGraph/trunk/examples/osgvnc/osgvnc.cpp
===================================================================
--- OpenSceneGraph/trunk/examples/osgvnc/osgvnc.cpp (revision 12292)
+++ OpenSceneGraph/trunk/examples/osgvnc/osgvnc.cpp (revision 12851)
@@ -1,4 +1,5 @@
 #include <osgWidget/VncClient>
 
+#include <osgDB/Registry>
 #include <osgViewer/Viewer>
 #include <osgViewer/ViewerEventHandlers>
@@ -47,8 +48,21 @@
     osg::ref_ptr<osg::Group> group = new osg::Group;
 
+    std::string password;
+    while(arguments.read("--password",password))
+    {
+    }
+
     for(int i=1; i<arguments.argc(); ++i)
     {
         if (!arguments.isOption(i))
         {
+            std::string hostname = arguments[i];
+
+            if (!password.empty())
+            {
+                if (!osgDB::Registry::instance()->getAuthenticationMap()) osgDB::Registry::instance()->setAuthenticationMap(new osgDB::AuthenticationMap);
+                osgDB::Registry::instance()->getAuthenticationMap()->addAuthenticationDetails(hostname, new osgDB::AuthenticationDetails("", password));
+            }
+
             osg::ref_ptr<osgWidget::VncClient> vncClient = new osgWidget::VncClient;
             if (vncClient->connect(arguments[i], hints))
