summaryrefslogtreecommitdiffstats
path: root/testapi/opnfv_testapi/ui
diff options
context:
space:
mode:
authorSerena Feng <feng.xiaowei@zte.com.cn>2017-05-20 07:30:09 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-05-20 07:30:09 +0000
commit94fd99430ff0c13803fea0f464d5175194e1c32e (patch)
treefd2bb4a28bb8ba02b163856d8ba06543d11b6bf0 /testapi/opnfv_testapi/ui
parent027815dac7d5b922ef9e048211b44e28f4131ff5 (diff)
parent5f9b0d1c9de2cc3a094c31467e2be697b4ac20e3 (diff)
Merge "add signout funcationality"
Diffstat (limited to 'testapi/opnfv_testapi/ui')
-rw-r--r--testapi/opnfv_testapi/ui/auth/constants.py2
-rw-r--r--testapi/opnfv_testapi/ui/auth/sign.py12
2 files changed, 14 insertions, 0 deletions
diff --git a/testapi/opnfv_testapi/ui/auth/constants.py b/testapi/opnfv_testapi/ui/auth/constants.py
index ec59751..43f69d7 100644
--- a/testapi/opnfv_testapi/ui/auth/constants.py
+++ b/testapi/opnfv_testapi/ui/auth/constants.py
@@ -1,3 +1,5 @@
+OPENID = 'openid'
+
# OpenID parameters
OPENID_MODE = 'openid.mode'
OPENID_NS = 'openid.ns'
diff --git a/testapi/opnfv_testapi/ui/auth/sign.py b/testapi/opnfv_testapi/ui/auth/sign.py
index c92196a..7319084 100644
--- a/testapi/opnfv_testapi/ui/auth/sign.py
+++ b/testapi/opnfv_testapi/ui/auth/sign.py
@@ -43,3 +43,15 @@ class SigninReturnHandler(base.BaseHandler):
if not self.get_secure_cookie('openid'):
self.set_secure_cookie('openid', openid)
self.redirect(url=CONF.ui_url)
+
+
+class SignoutHandler(base.BaseHandler):
+ def get(self):
+ """Handle signout request."""
+ openid = self.get_secure_cookie(const.OPENID)
+ if openid:
+ self.clear_cookie(const.OPENID)
+ params = {'openid_logout': CONF.osid_openid_logout_endpoint}
+ url = parse.urljoin(CONF.ui_url,
+ '/#/logout?' + parse.urlencode(params))
+ self.redirect(url)