diff options
author | SerenaFeng <feng.xiaowei@zte.com.cn> | 2017-05-19 16:24:45 +0800 |
---|---|---|
committer | SerenaFeng <feng.xiaowei@zte.com.cn> | 2017-05-20 15:35:51 +0800 |
commit | ff3b3116de42dbd63fe8952700de7fa2a7134502 (patch) | |
tree | 343eb46f8c15f15fa1eb4371980b2cc8b97b0822 /testapi/opnfv_testapi/ui | |
parent | 94fd99430ff0c13803fea0f464d5175194e1c32e (diff) |
support cancel operation while signing in
support the cancel operation in the
https://openstackid.org/accounts/user/consent
Change-Id: I06a1f130a3115774f2e88fc25dad522a7cf53e36
Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'testapi/opnfv_testapi/ui')
-rw-r--r-- | testapi/opnfv_testapi/ui/auth/sign.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/testapi/opnfv_testapi/ui/auth/sign.py b/testapi/opnfv_testapi/ui/auth/sign.py index 7319084..6a9d94e 100644 --- a/testapi/opnfv_testapi/ui/auth/sign.py +++ b/testapi/opnfv_testapi/ui/auth/sign.py @@ -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): |