diff --git a/src/addressbook/e-book-backend-ews.c b/src/addressbook/e-book-backend-ews.c
index b1b1496..1c9493d 100644
--- a/src/addressbook/e-book-backend-ews.c
+++ b/src/addressbook/e-book-backend-ews.c
@@ -2640,6 +2641,12 @@ e_book_backend_ews_authenticate_user (EBookBackend *backend,
 		return;
 	}
 
+	if (!credentials || !e_credentials_peek (credentials, E_CREDENTIALS_KEY_USERNAME)) {
+		e_book_backend_notify_opened (backend, EDB_ERROR (AUTHENTICATION_REQUIRED));
+		e_book_backend_notify_readonly (backend, TRUE);
+		return;
+	}
+
 	esource = e_backend_get_source (E_BACKEND (backend));
 	host_url = e_source_get_property (esource, "hosturl");
 	read_only = e_source_get_property (esource, "read_only");
diff --git a/src/calendar/e-cal-backend-ews.c b/src/calendar/e-cal-backend-ews.c
index a701ae0..f50b18d 100644
--- a/src/calendar/e-cal-backend-ews.c
+++ b/src/calendar/e-cal-backend-ews.c
@@ -686,7 +686,7 @@ e_cal_backend_ews_authenticate_user (ECalBackend *backend,
 
 	if (!credentials || !e_credentials_has_key (credentials, E_CREDENTIALS_KEY_USERNAME)) {
 		PRIV_UNLOCK (priv);
-		g_propagate_error (&error, EDC_ERROR (AuthenticationFailed));
+		g_propagate_error (&error, EDC_ERROR (AuthenticationRequired));
 		e_cal_backend_notify_opened (backend, error);
 		return;
 	}
diff --git a/src/server/e-ews-connection.c b/src/server/e-ews-connection.c
index 6526b68..fdb3fc7 100644
--- a/src/server/e-ews-connection.c
+++ b/src/server/e-ews-connection.c
@@ -1210,6 +1210,11 @@ e_ews_connection_new (const gchar *uri,
 
 	g_static_mutex_lock (&connecting);
 
+	if (!username) {
+		g_static_mutex_unlock (&connecting);
+		return NULL;
+	}
+
 	/* search the connection in our hash table */
 	if (loaded_connections_permissions != NULL) {
 		hash_key = g_strdup_printf ("%s@%s",
