diff --git a/apps/remoteStorage/auth.php b/apps/remoteStorage/auth.php
index 99e2272d3abf4b59bee6cb3b35596b5ced405045..ad6382eac714a5604de7ed3d233b68167ff6e039 100644
--- a/apps/remoteStorage/auth.php
+++ b/apps/remoteStorage/auth.php
@@ -60,57 +60,15 @@ if($userId && $appUrl && $categories) {
       header('Location: '.$_GET['redirect_uri'].'#access_token='.$existingToken.'&token_type=bearer');
     } else {
       //params ok, logged in ok, but need to click Allow still:
-?>
-<!DOCTYPE html>
-<html>
-	<head>
-	<title>ownCloud</title>
-	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-	<link rel="shortcut icon" href="../../../core/img/favicon.png" /><link rel="apple-touch-icon-precomposed" href="../../../core/img/favicon-touch.png" />
-			<link rel="stylesheet" href="../../../core/css/styles.css" type="text/css" media="screen" />
-			<link rel="stylesheet" href="../../../core/css/auth.css" type="text/css" media="screen" />
-		</head>
-	<body id="body-login">
-	<div id="login">
-		<header>
-		<div id="header">
-			<img src="../../../core/img/logo.png" alt="ownCloud" />
-		</div>
-		</header>
-		<section id="main">
-		<div id="oauth">
-			<h2><img src="../../../core/img/remoteStorage-big.png" alt="remoteStorage" /></h2>
-			<p><strong><?php $appUrlParts = explode('/', $_GET['redirect_uri']); echo htmlentities($appUrlParts[2]); ?></strong>
-			requests read &amp; write access to your 
-			<?php
-				$categories = explode(',', htmlentities($_GET['scope']));
-				if(!count($categories)) {
-					echo htmlentities($_GET['scope']);
-				} else {
-					echo '<em>'.$categories[0].'</em>';
-					if(count($categories)==2) {
-						echo ' and <em>'.$categories[1].'</em>';
-					} else if(count($categories)>2) {
-						for($i=1; $i<count($categories)-1; $i++) {
-							echo ', <em>'.$categories[$i].'</em>';
-						}
-						echo ', and <em>'.$categories[$i].'</em>';
-					}
-				}
-			?>.
-			</p>
-			<form accept-charset="UTF-8" method="post">
-				<input id="allow-auth" name="allow" type="submit" value="Allow" />
-				<input id="deny-auth" name="deny" type="submit" value="Deny" />
-			</form>
-		</div>
-		</section>
-	</div>
-	<footer><p class="info"><a href="http://owncloud.org/">ownCloud</a> &ndash; web services under your control</p></footer>
-	</body>
-</html>
-<?php
-		}//end 'need to click Allow still'
+	$appUrlParts = explode('/', $_GET['redirect_uri']);
+	$host = $appUrlParts[2];
+	$categories = explode(',', $_GET['scope']);
+	OCP\Util::addStyle('', 'auth');
+	OCP\Template::printGuestPage('remoteStorage', 'auth', array(
+		'host' => $host,
+		'categories' => $categories,
+	));
+	}//end 'need to click Allow still'
 	} else {//login not ok
 		if($currUser) {
 			die('You are logged in as '.$currUser.' instead of '.htmlentities($userId));
diff --git a/apps/remoteStorage/templates/auth.php b/apps/remoteStorage/templates/auth.php
new file mode 100644
index 0000000000000000000000000000000000000000..6a7054eabb06b86908798aae051ee5d2dd694280
--- /dev/null
+++ b/apps/remoteStorage/templates/auth.php
@@ -0,0 +1,28 @@
+		<section id="main">
+		<div id="oauth">
+			<h2><img src="<?php echo image_path('', 'remoteStorage-big.png'); ?>" alt="remoteStorage" /></h2>
+			<p><strong><?php echo $_['host'] ?></strong>
+			requests read &amp; write access to your 
+			<?php
+				$categories = $_['categories'];
+				if(!count($categories)) {
+					echo $categories[0];
+				} else {
+					echo '<em>'.$categories[0].'</em>';
+					if(count($categories)==2) {
+						echo ' and <em>'.$categories[1].'</em>';
+					} else if(count($categories)>2) {
+						for($i=1; $i<count($categories)-1; $i++) {
+							echo ', <em>'.$categories[$i].'</em>';
+						}
+						echo ', and <em>'.$categories[$i].'</em>';
+					}
+				}
+			?>.
+			</p>
+			<form accept-charset="UTF-8" method="post">
+				<input id="allow-auth" name="allow" type="submit" value="Allow" />
+				<input id="deny-auth" name="deny" type="submit" value="Deny" />
+			</form>
+		</div>
+		</section>