Univention Bugzilla – Attachment 5435 Details for
Bug 24422
Single-Sign-On for UMC
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
sso.sh simple test script
sso.sh (text/x-sh), 1.61 KB, created by
Florian Best
on 2013-09-18 10:45 CEST
(
hide
)
Description:
sso.sh simple test script
Filename:
MIME Type:
Creator:
Florian Best
Created:
2013-09-18 10:45 CEST
Size:
1.61 KB
patch
obsolete
>#!/bin/bash > >host=${1:-"master"} >target=${2:-"slave"} >username=${3:-"Administrator"} >password=${4:-"univention"} > >COOKIEJAR="$(mktemp)" >TOKEN='' > >function c() { > curl -s --cookie '$COOKIEJAR' --cookie-jar '$COOKIEJAR' -H 'Content-Type: application/json' >} > >function auth() { > c http://"$host"/umcp/auth -d '{"options":{"username":"'"$username"'","password":"'"$password"'"}}' >} > > >function get_token() { > c http://$host/umcp/command/lib/sso/getsession -d '{"options":{"host":"'"$target"'"}}' | python -c 'import sys, json; print json.loads(sys.stdin.read()).get("result",{}).get("loginToken") or sys.exit(1)' >} > >function fail () { > echo "TEST failed: function: $1" >} > >function target_is_unreachable() { > ssh $target 'invoke-rc.d apache2 stop' > get_token && fail 'target_is_unreachable' > ssh $target 'invoke-rc.d apache2 start' >} > >function target_dns_error() { > t="$target" > target="asdf.asdf.asdf" > get_token && fail 'target_dns_error' > target="$t" >} > >remote_login() { > curl -i http://$target/umcp/sso?loginToken=$TOKEN | grep -i 'Set-Cookie:\s\+UMCSessionId' >} > >function timeout_works() { > timeout=15 > ssh $target "ucr set umc/web/sso/timeout=$timeout" > TOKEN=$(get_token) > sleep $timeout > remote_login && fail 'timeout_works' >} > >function token_invalidated() { > TOKEN=$(get_token) > remote_login || fail 'token_invalidated,1' > remote_login && fail 'token_invalidated,2' >} > ># TODO: from different IPs, wrong CA, offline > >function test() { > auth > TOKEN=$(get_token) || (fail 'get_token' && exit 1) > remote_login || (fail 'remote_login' && exit 1) > > target_dns_error > target_is_unreachable > timeout_works > token_invalidated > echo 'test finished' >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
Attachments on
bug 24422
: 5435 |
5436