Commit 45fd3834 authored by ale's avatar ale

partial revert of the previous commit: the base64 issue was limited to mod_sso

parent b39c0602
......@@ -512,7 +512,7 @@ static int mod_sso_authenticate_user(request_rec *r)
mod_sso_parse_requirements(r, req_groups, req_users, &allow_any_user);
// Test for valid cookie
string sso_cookie = modsso::base64_decode(get_cookie(r, sso_cookie_name));
string sso_cookie = get_cookie(r, sso_cookie_name);
if (!sso_cookie.empty()) {
sso::Verifier verifier(s_cfg->public_key, s_cfg->service,
s_cfg->domain, req_groups);
......
......@@ -63,7 +63,7 @@ class HttpdIntegrationTest(unittest.TestCase):
def testRedirectionUrls(self):
def mkcookie(tkt):
return "SSO_test=%s" % base64.b64encode(tkt)
return "SSO_test=%s" % tkt
# Tests have a name so that we can recognize failures.
checks = [
......@@ -154,7 +154,7 @@ class HttpdIntegrationTest(unittest.TestCase):
self.assertEquals(302, resp.status)
set_cookie = resp.getheader("Set-Cookie")
self.assertTrue(set_cookie)
self.assertTrue(base64.b64encode(tkt) in set_cookie)
self.assertTrue(tkt_enc in set_cookie)
conn.close()
# test the /sso_logout endpoint
......
import base64
import functools
import json
import logging
......@@ -84,12 +83,8 @@ def login():
# form.
local_ticket_str = request.cookies.get(SSO_COOKIE_NAME)
if local_ticket_str:
try:
local_ticket = app.login_service.local_authorize(
_tostr(base64.b64decode(local_ticket_str)))
except:
log.warn('error decoding ticket')
local_ticket = None
local_ticket = app.login_service.local_authorize(
_tostr(local_ticket_str))
else:
local_ticket = None
......@@ -113,8 +108,7 @@ def login():
return show_login_page(params, 'Authentication failed')
# Set local auth cookie.
local_ticket_str = base64.b64encode(
app.login_service.local_generate(username))
local_ticket_str = app.login_service.local_generate(username)
# At this point the user is authenticated, check authorization
# and create the single sign-on ticket.
......
......@@ -56,7 +56,7 @@ class SSOServerTest(unittest.TestCase):
shutil.rmtree(self.tmpdir)
def get_local_ticket(self, user):
return base64.b64encode(self.app.login_service.local_generate(user))
return self.app.login_service.local_generate(user)
def get_auth_client(self, user='user', ticketstr=None):
if not ticketstr:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment