wget Script for Downloading from edelivery Site
Hello,
I am able to use the wget command by exporting the Oracle sso cookies from a web browser just fine. My question is, is there a way to use a bash script to accomplish this similar to how there are scripts provided for patches, etc.?
I have attempted to edit one of the patch wget.sh scripts to do this but it seems the cookie generated from this bit of the script is not sufficient for edelivery authentication:
# Contact updates site so that we can get SSO Params for logging in
SSO_RESPONSE=`$WGET https://updates.oracle.com/Orion/Services/download 2>&1|grep Location`
# Extract request parameters for SSO
SSO_TOKEN=`echo $SSO_RESPONSE| cut -d '=' -f 2|cut -d ' ' -f 1`
SSO_SERVER=`echo $SSO_RESPONSE| cut -d ' ' -f 2|cut -d 'p' -f 1,2`
SSO_AUTH_URL=sso/auth
AUTH_DATA="ssousername=$SSO_USERNAME&password=$SSO_PASSWORD&site2pstoretoken=$SSO_TOKEN"
echo "Auth Data: "$AUTH_DATA >> $LOGFILE
# The following command to authenticate uses HTTPS. This will work only if the wget in the environment
# where this script will be executed was compiled with OpenSSL. Remove the --secure-protocol option
# if wget was not compiled with OpenSSL
# Depending on the preference, the other options are --secure-protocol= auto|SSLv2|SSLv3|TLSv1
$WGET user-agent="Mozilla/5.0" secure-protocol=auto post-data $AUTH_DATA save-cookies=$COOKIE_FILE --keep-session-cookies $SSO_SERVER$SSO_AUTH_URL -O sso.out >> $LOGFILE 2>&1