diff --git a/config/config.sample.php b/config/config.sample.php
index e3b46069fe8dd68f75b7c84e72c4135c483289ba..369873b19147651f34b58724821db5ec7dc3e367 100644
--- a/config/config.sample.php
+++ b/config/config.sample.php
@@ -1228,10 +1228,18 @@ $CONFIG = array(
 				'name' => 'default',
 			],
 		],
+		'scope' => [
+			'project' => [
+				'name' => 'service',
+				'domain' => [
+					'name' => 'default',
+				],
+			],
+		],
 		'tenantName' => 'service',
 		'serviceName' => 'swift',
 		'region' => 'regionOne',
-		'url' => "http://yourswifthost:5000/v3",
+		'url' => 'http://yourswifthost:5000/v3',
 		'bucket' => 'nextcloud',
 	],
 ],
diff --git a/lib/private/Files/ObjectStore/SwiftFactory.php b/lib/private/Files/ObjectStore/SwiftFactory.php
index 85bba5730017daca652d8c0ec4ecff2e086b6b28..caa4774daba8ec3d95706b16276364ae53761ecf 100644
--- a/lib/private/Files/ObjectStore/SwiftFactory.php
+++ b/lib/private/Files/ObjectStore/SwiftFactory.php
@@ -108,6 +108,10 @@ class SwiftFactory {
 		]);
 
 		if (isset($this->params['user']) && isset($this->params['user']['name'])) {
+			if (!isset($this->params['scope'])) {
+				throw new StorageAuthException('Scope has to be defined for V3 requests');
+			}
+
 			return $this->auth(IdentityV3Service::factory($httpClient), $cacheKey);
 		} else {
 			return $this->auth(IdentityV2Service::factory($httpClient), $cacheKey);