Here's a script I wrote for testing session timeouts...

Here's an example call...
sessionTimeoutTest.sh 295 60 https://cas-test.athabascau.ca/cas/login 
/tmp/credentials-student.txt

I don't know if it works with CAS 3 or not.  I think technically, according to 
the HTTP spec, as long as you do not modify any data somewhere, passing 
parameters on the GET line is acceptable.

The credentials-student.txt has a single line like 
"?username=blah&password=blah"

#!/bin/sh

# args timeout increment output.html logfile.log cookiefile url credentials.txt

TIMEOUT=$1
INCREMENT=$2
OUTPUT="`mktemp -t login.html.XXXXXXXXXX`"
LOGFILE="`mktemp -t session.log.XXXXXXXXXX`"
COOKIEFILE="`mktemp -t cookie.XXXXXXXXXX`"
URL=$3
CREDENTIALS=$4

wget --no-check-certificate -o $LOGFILE -O $OUTPUT \
--keep-session-cookies --load-cookies=$COOKIEFILE \
--save-cookies=$COOKIEFILE "${URL}`cat $CREDENTIALS`"

NOTTIMEDOUT=true
TOTALTIME=0
grep 'You have been logged' $OUTPUT
if [[ $? -ne 0 ]]; then
  NOTTIMEDOUT=false
  echo "LOGIN FAILED";
  echo "Timeout at $TIMEOUT";
  echo "Total time: $TOTALTIME";
fi
while $NOTTIMEDOUT -eq 'true'; do
  echo "Testing timeout at $TIMEOUT seconds";
  sleep $TIMEOUT
  ((TOTALTIME += $TIMEOUT));
  wget --no-check-certificate -o $LOGFILE -O $OUTPUT --keep-session-cookies \
    --load-cookies=$COOKIEFILE --save-cookies=$COOKIEFILE "$URL"
  grep 'You have been logged' $OUTPUT
  if [[ $? -ne 0 ]]; then
    NOTTIMEDOUT=false
    echo "Timeout at $TIMEOUT";
    echo "Total time: $TOTALTIME";
  fi
  ((TIMEOUT += $INCREMENT)); # up the session test in 15 minute intervals
done;


Trenton D. Adams
Systems Analyst/Web Software Engineer
Navy Penguins at your service!
Athabasca University
(780) 675-6195
:wq!

----- "Chris" <[EMAIL PROTECTED]> wrote:

> The wget with cookie params is interesting but if I remember I cannot
> 
> send username & password thru the URL. So I guess I need to use curl
> first?
> 
> Anyone has an experience with wget & CAS ?
> 
> 
> 
> #Mirror website to a static copy for local browsing.
> #This means all links will be changed to point to the local files.
> #Note --html-extension will convert any CGI, ASP or PHP generated
> files 
> to HTML (or anything else not .html).
> wget --mirror -w 2 -p --html-extension --convert-links -P <dir> 
> http://www.yourdomain.com
> 
> _______________________________________________
> Yale CAS mailing list
> [email protected]
> http://tp.its.yale.edu/mailman/listinfo/cas

__ 
    This communication is intended for the use of the recipient to whom it
    is addressed, and may contain confidential, personal, and or privileged
    information. Please contact us immediately if you are not the intended
    recipient of this communication, and do not copy, distribute, or take
    action relying on it. Any communications received in error, or
    subsequent reply, should be deleted or destroyed.
---
_______________________________________________
Yale CAS mailing list
[email protected]
http://tp.its.yale.edu/mailman/listinfo/cas

Reply via email to