LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 09-09-2010, 02:40 AM   #1
manya
Member
 
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
marozsas
Senior Member
 
Registered: Dec 2005
Location: Campinas/SP - Brazil
Distribution: SuSE, RHEL, Fedora, Ubuntu
Posts: 1,393
Blog Entries: 1

Rep: Reputation: 63
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.

Code:
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. 

SITEMINDERLOGON="http://siteminder/servlet/logon?option1=whatever&option2=whatever2&username=$USERNAME&password=$PASSWORD"

# 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
 
  


Reply


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


All times are GMT -5. The time now is 01:58 PM.

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