summaryrefslogtreecommitdiffstats
path: root/core/Controller
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2017-08-24 14:00:33 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2017-08-26 13:48:08 +0200
commit6676232a56ec698c43dc432c1003d12f54e549b3 (patch)
tree3710b0ae728f22ee14c015a801b078dcb6fa8d63 /core/Controller
parentcfe5d35862062181883e616ae608b0b0c96aac60 (diff)
downloadnextcloud-server-6676232a56ec698c43dc432c1003d12f54e549b3.tar.gz
nextcloud-server-6676232a56ec698c43dc432c1003d12f54e549b3.zip
Allow 2FA providers to specify their custom CSP
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'core/Controller')
-rw-r--r--core/Controller/TwoFactorChallengeController.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/core/Controller/TwoFactorChallengeController.php b/core/Controller/TwoFactorChallengeController.php
index 9f379ad30d7..9c22da8ae09 100644
--- a/core/Controller/TwoFactorChallengeController.php
+++ b/core/Controller/TwoFactorChallengeController.php
@@ -1,4 +1,5 @@
<?php
+
/**
* @copyright Copyright (c) 2016, ownCloud, Inc.
*
@@ -29,6 +30,7 @@ use OC_Util;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\RedirectResponse;
use OCP\AppFramework\Http\TemplateResponse;
+use OCP\Authentication\TwoFactorAuth\IProvidesCustomCSP;
use OCP\Authentication\TwoFactorAuth\TwoFactorException;
use OCP\IRequest;
use OCP\ISession;
@@ -135,7 +137,11 @@ class TwoFactorChallengeController extends Controller {
'redirect_url' => $redirect_url,
'template' => $tmpl->fetchPage(),
];
- return new TemplateResponse($this->appName, 'twofactorshowchallenge', $data, 'guest');
+ $response = new TemplateResponse($this->appName, 'twofactorshowchallenge', $data, 'guest');
+ if ($provider instanceof IProvidesCustomCSP) {
+ $response->setContentSecurityPolicy($provider->getCSP());
+ }
+ return $response;
}
/**