diff --git a/settings/oauth.php b/settings/oauth.php
index 9e7a3c04935722f32ee6e13821195cfb05974567..b04c798b1b0a81ed0948ae35a849514d0d7a5714 100644
--- a/settings/oauth.php
+++ b/settings/oauth.php
@@ -27,7 +27,7 @@ switch($operation){
 		}
 		break;
 	case 'authorise';
-		OC_Util::checkLoggedIn();
+		OC_API::checkLoggedIn();
 		// Example
 		$consumer = array(
 			'name' => 'Firefox Bookmark Sync',
@@ -38,6 +38,8 @@ switch($operation){
 		$apps = OC_App::getEnabledApps();
 		$notfound = array();
 		foreach($consumer['scopes'] as $requiredapp){
+			// App scopes are in this format: app_$appname
+			$requiredapp = end(explode('_', $requiredapp));
 			if(!in_array($requiredapp, $apps)){
 				$notfound[] = $requiredapp;
 			}