Improve logout

The persistence of the openstackid session causes issues where
when people log out, then click "Sign-In" again, they  aren't
prompted for their password. Instead they are logged in automatically
with the users they just logged out from because the openstackid endpoint
still has them as logged in. With this patch, the user will be logged
out of refstack as well as openstackid when signing out of RefStack.

This way a  user can sign into refstack with another openstackid
without having to delete cookies or navigate to the openstackid site
to manually log out.

Change-Id: I23936ba6b64b58e4f6a3f4d62ba89439c4ddee21
This commit is contained in:
Paul Van Eck
2015-10-20 15:20:47 -07:00
parent dfb32eb576
commit aa3966ea7a
8 changed files with 86 additions and 7 deletions

View File

@@ -413,6 +413,8 @@ class AuthControllerTestCase(BaseControllerTestCase):
self.CONF = self.useFixture(self.config_fixture).conf
self.CONF.set_override('app_dev_mode', True, 'api')
self.CONF.set_override('ui_url', 'http://127.0.0.1')
self.CONF.set_override('openid_logout_endpoint', 'http://some-url',
'osid')
@mock.patch('refstack.api.utils.get_user_session')
@mock.patch('pecan.redirect', side_effect=webob.exc.HTTPRedirection)
@@ -527,7 +529,8 @@ class AuthControllerTestCase(BaseControllerTestCase):
const.CSRF_TOKEN: 42
}
self.assertRaises(webob.exc.HTTPRedirection, self.controller.signout)
mock_redirect.assert_called_with('http://127.0.0.1')
mock_redirect.assert_called_with('http://127.0.0.1/#/logout?'
'openid_logout=http%3A%2F%2Fsome-url')
self.assertNotIn(const.CSRF_TOKEN,
mock_request.environ['beaker.session'])