Commit 1847405c authored by marcus-tun's avatar marcus-tun
Browse files

turned to cheaper solution after a long javascript fight...

parent b375a018
......@@ -89,12 +89,12 @@ assertion = httpGet("https://saml-delegation.data.kit.edu/sd/ecp.py")
// encode assertion
//b64assertion = encode64(assertion);
b64assertion = base64_encode(assertion);
document.write(b64assertion);
document.write('<br/>\n\n<br/>');
document.write(assertion);
//document.write(b64assertion);
//document.write('<br/>\n\n<br/>');
//document.write(assertion);
url = post("https://saml-delegation.data.kit.edu/sd/upload.py", {encrypted_assertion: b64assertion});
url = post("https://saml-delegation.data.kit.edu/sd/jsupload.py", {encrypted_assertion: b64assertion});
//response = post("https://saml-delegation.data.kit.edu/sd/jsupload.py", {encrypted_assertion: assertion});
document.write('You can use this url as a temporary password in all federation-enabled services:<br/>');
......
......@@ -62,19 +62,16 @@ def handler(req):
# ecp
if location == 'ecp.py':
req.content_type='application/octet-stream'\
# octet stream will force saving to disk, while
# text will allow to open with a text editor
#req.content_type='application/octet-stream'\
req.content_type='application/text'\
'\nContent-Disposition: attachment; filename=samlup_uXXXX.tmp'
req.write(assertion)
return apache.OK
# upload via javascript
if location == 'jsupload.py':
req.content_type = 'text/plain'
req.write("not here")
return apache.OK
# upload
if location == 'upload.py':
if location in ( 'upload.py', 'jsupload.py'):
req.content_type = 'text/plain'
# we expect the data via post in encrypted assertion.
# we will return the url of where to collect the assertion
......@@ -103,7 +100,11 @@ def handler(req):
file.write(encrypted_assertion)
file.close()
req.write("url=%s" % assertion_url)
if location == 'jsupload.py':
req.write('You can use this url as a temporary password in all federation-enabled services:\n\n%s' % assertion_url);
else:
req.write("url=%s" % assertion_url)
return apache.OK
......
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