Share your knowledge at the LQ Wiki.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 09-09-2010, 02:40 AM   #1
Registered: Apr 2004
Posts: 194

Rep: Reputation: 15
How to authenticate against SSO when using wget

Hi All,

I am writing a bash script where I would need to down load few file from server but the glitch is authentication is being performed by SSO/Siteminder server.
Does anyone aware of a option or trick with wget or curl to authenticate against SSO and then download the file from the server.

Standard http-user and http-password definitely does not suffice the need.
Old 09-11-2010, 04:27 PM   #2
Senior Member
Registered: Dec 2005
Location: Campinas/SP - Brazil
Distribution: SuSE, RHEL, Fedora, Ubuntu
Posts: 1,402
Blog Entries: 1

Rep: Reputation: 64
I don't know how Siteminder authenticate his users, but there is a big chance it uses a POST method to do it.
wget or curls will not work because they can't handle HTTP/POST as a browser does. Try lynx.

Based on another authenticated site, I developed a bash script to authenticate and download files. I hope it can help you as a starting point.

USERNAME="myusername";          ### replace with your username   ###
PASSWORD="password";            ### replace with your password   ###

POST_DATA="username=$USERNAME&password=$PASSWORD";  # you must check how the username and password are expected by siteminder. 


# the above string is the key here. It is the how siteminder expects an answer when you hit the login button on your browser. You must reproduce the exact string and this could be tricky. Inspecting the source code of auhtentication page may help.

echo -e $POST_DATA | lynx --dump --accept_all_cookies -post_data $SITEMINDERLOGON

# after that lynx holds a session using cockies. No authentication is needed from this point
lynx --dump --accept_all_cookies http://siteminder/path/to/your/file > saved_file


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
wget with proxy,but authenticate fail willie118 Linux - Networking 9 01-17-2010 05:56 AM
SSO ?? maas187 Linux - Server 5 01-13-2010 02:54 PM
use wget to authenticate into facebook aquafina Programming 1 12-10-2007 07:17 PM
authenticate a web filter in the terminal? (for use of yum, wget, etc) unknown_mosquito Linux - Security 2 05-02-2006 08:51 PM
wget won't authenticate with a MPS 2.0 Proxy graywind Linux - Networking 0 12-16-2003 01:49 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:21 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration