Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
marcus.hardt
pluto
Commits
6032bea6
Commit
6032bea6
authored
Nov 19, 2015
by
marcus-tun
Browse files
More fixes for shorter url to work
parent
ae0f7f5b
Changes
2
Hide whitespace changes
Inline
Side-by-side
server/js-new.js
View file @
6032bea6
...
@@ -42,16 +42,16 @@ $.get( from, function( assertion, stat ) {
...
@@ -42,16 +42,16 @@ $.get( from, function( assertion, stat ) {
console
.
log
(
'
out:
'
+
out
);
console
.
log
(
'
out:
'
+
out
);
console
.
log
(
'
enc_ass:
'
+
enc_assertion
);
console
.
log
(
'
enc_ass:
'
+
enc_assertion
);
$
.
post
(
to
,
out
,
function
(
data
,
stat
){
$
.
post
(
to
,
out
,
function
(
data
,
stat
){
console
.
log
(
'
sending
'
);
console
.
log
(
'
sending
'
);
console
.
log
(
'
buf:
'
+
buf
);
// replace content in the template
// replace content in the template
buf
=
data
.
split
(
"
url
=
"
);
buf
=
data
.
split
(
"
&
"
);
url
=
buf
[
1
]
.
split
(
"
=
"
)
[
1
]
;
url
=
buf
[
1
]
;
shorturl
=
buf
[
2
].
split
(
"
=
"
)[
1
];
console
.
log
(
'
url:
'
+
url
)
;
$
(
"
#url2
"
).
html
(
'
<a href="
'
+
url
+
'
">encrypted assertion</a>
'
);
console
.
log
(
'
shorturl
'
+
shorturl
);
$
(
"
#url2
"
).
html
(
'
<a
$
(
"
#url
"
).
text
(
url
+
"
?k=
"
+
key
);
href="
'
+
url
+
'
">encrypted assertion</a>
'
);
$
(
"
#short_
url
"
).
text
(
short_
url
+
"
?k=
"
+
key
);
$
(
"
#
url
"
).
text
(
url
+
"
?k=
"
+
key
);
$
(
"
#stat_post
"
).
text
(
stat
)
$
(
"
#shorturl
"
).
text
(
shorturl
+
"
?k=
"
+
key
);
})
$
(
"
#stat_post
"
).
text
(
stat
)
})
console
.
log
(
'
sent encrypted assertion out
'
);
console
.
log
(
'
sent encrypted assertion out
'
);
$
(
"
#stat_get
"
).
text
(
"
success
"
);
$
(
"
#stat_get
"
).
text
(
"
success
"
);
...
...
server/sso.py
View file @
6032bea6
...
@@ -61,7 +61,7 @@ def handler(req):
...
@@ -61,7 +61,7 @@ def handler(req):
</table>
</table>
<br/><p> You can now use this URL as a temporary password:<br/>
<br/><p> You can now use this URL as a temporary password:<br/>
<b id="short
_
url"> Wait </b></p>
<b id="shorturl"> Wait </b></p>
<br/><p> You can now use this URL as a temporary password:<br/>
<br/><p> You can now use this URL as a temporary password:<br/>
<b id="url"> Wait </b></p>
<b id="url"> Wait </b></p>
...
@@ -111,14 +111,15 @@ def handler(req):
...
@@ -111,14 +111,15 @@ def handler(req):
# create hash
# create hash
assertion_hash
=
str
(
hashlib
.
md5
(
encrypted_assertion
).
hexdigest
())[
0
:
8
]
assertion_hash
=
str
(
hashlib
.
md5
(
encrypted_assertion
).
hexdigest
())[
0
:
8
]
assertion_short_url
=
'https://'
+
assertion_hash
assertion_url
=
'https://'
+
req
.
hostname
+
'/assertions/'
+
assertion_hash
assertion_url
=
'https://'
+
req
.
hostname
+
'/assertions/'
+
assertion_hash
# Publish encrypted assertion on the web
# Publish encrypted assertion on the web
write_var
(
req
,
encrypted_assertion
,
assertion_hash
)
write_var
(
req
,
encrypted_assertion
,
assertion_hash
)
# return the url as key=value FIXME
# return the url as key=value FIXME
req
.
write
(
"url=%s"
%
assertion_url
)
req
.
write
(
"
&
url=%s"
%
assertion_url
)
req
.
write
(
"short
_
url=%s"
%
'https://'
+
assertion_
ha
sh
)
req
.
write
(
"
&
shorturl=%s"
%
assertion_sh
ort_url
)
#req.write("%s" % assertion_url)
#req.write("%s" % assertion_url)
#########
#########
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment