support cancel operation while signing in 45/35045/3
authorSerenaFeng <feng.xiaowei@zte.com.cn>
Fri, 19 May 2017 08:24:45 +0000 (16:24 +0800)
committerSerenaFeng <feng.xiaowei@zte.com.cn>
Sat, 20 May 2017 07:35:51 +0000 (15:35 +0800)
support the cancel operation in the
https://openstackid.org/accounts/user/consent

Change-Id: I06a1f130a3115774f2e88fc25dad522a7cf53e36
Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
utils/test/testapi/3rd_party/static/testapi-ui/shared/alerts/alertModalFactory.js
utils/test/testapi/opnfv_testapi/router/url_mappings.py
utils/test/testapi/opnfv_testapi/ui/auth/sign.py

index 3ce76c9..929f543 100644 (file)
@@ -28,7 +28,7 @@
     function raiseAlert($uibModal) {
         return function(mode, title, text) {
             $uibModal.open({
-                templateUrl: '/shared/alerts/alertModal.html',
+                templateUrl: 'testapi-ui/shared/alerts/alertModal.html',
                 controller: 'RaiseAlertModalController as alert',
                 backdrop: true,
                 keyboard: true,
index aea85a4..a2312de 100644 (file)
@@ -55,7 +55,7 @@ mappings = [
     (r"/api/v1/scenarios/([^/]+)", scenario_handlers.ScenarioGURHandler),
 
     # static path
-    (r'/(.*\.(css|png|gif|js|html|json|map))',
+    (r'/(.*\.(css|png|gif|js|html|json|map|woff2|woff|ttf))',
      tornado.web.StaticFileHandler,
      {'path': config.Config().static_path}),
 
index 7319084..6a9d94e 100644 (file)
@@ -32,6 +32,9 @@ class SigninHandler(base.BaseHandler):
 
 class SigninReturnHandler(base.BaseHandler):
     def get(self):
+        if self.get_query_argument(const.OPENID_MODE) == 'cancel':
+            self._auth_failure('Authentication canceled.')
+
         openid = self.get_query_argument(const.OPENID_CLAIMED_ID)
         user_info = {
             'openid': openid,
@@ -44,6 +47,12 @@ class SigninReturnHandler(base.BaseHandler):
             self.set_secure_cookie('openid', openid)
         self.redirect(url=CONF.ui_url)
 
+    def _auth_failure(self, message):
+        params = {'message': message}
+        url = parse.urljoin(CONF.ui_url,
+                            '/#/auth_failure?' + parse.urlencode(params))
+        self.redirect(url)
+
 
 class SignoutHandler(base.BaseHandler):
     def get(self):