Index: libs/internals/connectionpersistence.cpp
===================================================================
--- libs/internals/connectionpersistence.cpp	(revision 1049066)
+++ libs/internals/connectionpersistence.cpp	(revision 1049067)
@@ -252,6 +252,7 @@
             kDebug() << "Reading all entries for connection";
             QMap<QString,QMap<QString,QString> > entries;
             QString key = m_connection->uuid() + QLatin1String("*");
+            bool missingEntry = false;
 
             if (wallet->readMapList(key, entries) == 0) {
                 foreach (Setting * setting, m_connection->settings()) {
@@ -259,14 +260,23 @@
 
                     if (entries.contains(settingKey)) {
                         QMap<QString,QString> settingSecrets = entries.value(settingKey);
+                        if (settingSecrets.isEmpty()) {
+                            kDebug() << "no secrets found for" << settingKey;
+                            missingEntry = true;
+                            break;
+                        }
                         kDebug() << settingSecrets;
                         persistenceFor(setting)->restoreSecrets(settingSecrets);
+                    } else if (setting->hasSecrets()) {
+                        missingEntry = true;
                     }
                 }
                 kDebug() << "Check connection:";
                 kDebug() << "secretsAvailable:" << m_connection->secretsAvailable();
-
-                emit loadSecretsResult(EnumError::NoError);
+                if (missingEntry)
+                    emit loadSecretsResult(EnumError::MissingContents);
+                else
+                    emit loadSecretsResult(EnumError::NoError);
             } else {
                 kDebug() << "Wallet::readEntryList for :" << key << " failed";
                 emit loadSecretsResult(EnumError::MissingContents);
Index: libs/ui/connectionsecretsjob.cpp
===================================================================
--- libs/ui/connectionsecretsjob.cpp	(revision 1049066)
+++ libs/ui/connectionsecretsjob.cpp	(revision 1049067)
@@ -39,6 +39,7 @@
 
 #include <KDialog>
 #include <KLocale>
+#include <KServiceTypeTrader>
 #include <KStandardDirs>
 
 #include "802_11_wirelesswidget.h"
@@ -53,8 +54,11 @@
 #include "security/securitywidget.h"
 #include "security/securitywired8021x.h"
 
+#include "settings/vpn.h"
+
 #include "knmserviceprefs.h"
 #include "connection.h"
+#include "vpnuiplugin.h"
 
 ConnectionSecretsJob::ConnectionSecretsJob(Knm::Connection* connection, const QString &settingName,
                                            const QStringList& secrets, bool requestNew, const QDBusMessage& request)
@@ -131,7 +135,20 @@
     } else if ( mSettingName == QLatin1String(NM_SETTING_SERIAL_SETTING_NAME)) {
         m_settingWidget = new PppWidget(m_connection, 0);
     } else if ( mSettingName == QLatin1String(NM_SETTING_VPN_SETTING_NAME)) {
-        // not supported yet, figure out the type of the vpn plugin, load it and its m_settingWidgetget
+        // get the type of vpn service
+        QString configFile = KStandardDirs::locate("data",
+                Knm::ConnectionPersistence::CONNECTION_PERSISTENCE_PATH + m_connection->uuid());
+        m_connectionPersistence = new Knm::ConnectionPersistence(m_connection,
+                KSharedConfig::openConfig(configFile, KConfig::NoGlobals),
+                (Knm::ConnectionPersistence::SecretStorageMode)KNetworkManagerServicePrefs::self()->secretStorageMode());
+        m_connectionPersistence->load();
+        Knm::VpnSetting * vpnSetting = static_cast<Knm::VpnSetting*>(m_connection->setting(Knm::Setting::Vpn));
+        // load the plugin and get its setting widget
+        QString error;
+        VpnUiPlugin * uiPlugin = KServiceTypeTrader::createInstanceFromQuery<VpnUiPlugin>( QString::fromLatin1( "NetworkManagement/VpnUiPlugin" ), QString::fromLatin1( "[X-KDE-PluginInfo-Name]=='%1'" ).arg(vpnSetting->pluginName() ), this, QVariantList(), &error );
+        if (uiPlugin && error.isEmpty()) {
+            m_settingWidget= uiPlugin->widget(m_connection, 0);
+        }
     } else if ( mSettingName == QLatin1String(NM_SETTING_WIRED_SETTING_NAME)) {
         m_settingWidget = new WiredWidget(m_connection, 0);
     } else if ( mSettingName == QLatin1String(NM_SETTING_WIRELESS_SECURITY_SETTING_NAME)) {
