diff options
author | SerenaFeng <feng.xiaowei@zte.com.cn> | 2017-05-19 14:50:17 +0800 |
---|---|---|
committer | SerenaFeng <feng.xiaowei@zte.com.cn> | 2017-05-19 14:50:17 +0800 |
commit | d8873d3488e7ddf33d05ef25fb0c4cdbe6563c22 (patch) | |
tree | 0b3c68ba3cf286966854348dd3aa855a027efce1 /utils/test/testapi/opnfv_testapi/ui | |
parent | 076e3ee6a990acc801554edfc63798dc42c32707 (diff) |
add signout funcationality
Change-Id: Ie101f07f0eb406eee4e1c7daa14b07aaaf554904
Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'utils/test/testapi/opnfv_testapi/ui')
-rw-r--r-- | utils/test/testapi/opnfv_testapi/ui/auth/constants.py | 2 | ||||
-rw-r--r-- | utils/test/testapi/opnfv_testapi/ui/auth/sign.py | 12 |
2 files changed, 14 insertions, 0 deletions
diff --git a/utils/test/testapi/opnfv_testapi/ui/auth/constants.py b/utils/test/testapi/opnfv_testapi/ui/auth/constants.py index ec5975171..43f69d7f5 100644 --- a/utils/test/testapi/opnfv_testapi/ui/auth/constants.py +++ b/utils/test/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/utils/test/testapi/opnfv_testapi/ui/auth/sign.py b/utils/test/testapi/opnfv_testapi/ui/auth/sign.py index c92196a7a..73190841f 100644 --- a/utils/test/testapi/opnfv_testapi/ui/auth/sign.py +++ b/utils/test/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) |