• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

Server Authentication - pl. help me yaar

Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear All,
I have designed a website. In that website, I am trying to get the user name and password of a user and trying to get the authentication for the user from my "WEB SERVER" and from my "DOMINO SERVER"...the authentication is done for both the cases as expected. also if i try to get the cookies from the address bar, using the i can get two cookies, one from the WEBSERVER and another one from the DOMINO SERVER.
but if i approach the same authentication process, from my below program, the problem is, after authentication, i can get only the cookie sent by the WEB SERVER. I can't able to get the cookie sent by my DOMINO SERVER. This is becoz of the reason that, as soon as i get authenticated from the domino server, it is going to the second page. Since the cookie for the domino server exists only in the first page, i can't able to catch the cookie present in the first page....I am using the statement, "HttpURLConnection.setFollowRedirects(false);". but it is still redirected to the second page from the first page... how to avoid this and catch the cookie of the DOMINO SERVER.
Pl. help me yaaar.
I am hanging over here for the past 18 days...very badly.
pl. suggest me some ideas......
If i contact thru the browser, the browser can fetch both the cookies....but thru my program, i cant able to get both the cookies...pl. suggest me with some ideas, for stopping the redirection process of the login page to the next page and to catch the cookie of the DOMINO SERVER.
Any kind of suggestions are highly welcome...and very highly appreciatable....
Sakthivel S.
P.S: waiting for any kind of suggestions....very eagerly.
My program and the output for ur kind persual:
import java.io.*;
import java.net.*;
public class authen_new
public static void main(String args[]) throws Exception
String cookie="";
HttpURLConnection urlconnection = null;
URL theurl = new URL("http://www.maintenance.com/loginme");
HttpURLConnection hurl = (HttpURLConnection)(theurl.openConnection());
String idpassword = "username=allusers&password=12345";
OutputStream o= hurl.getOutputStream();
byte[] by= idpassword.getBytes();
int ic=0;
String key="";
while (ic<=10)
key = hurl.getHeaderFieldKey (ic);
String value = hurl.getHeaderField (ic++);
System.out.println(key + " - " + value);
System.out.println(cookie +"*************");

The Output of the above program:
null - HTTP/1.1 302 Found
Date - Fri, 15 Nov 2002 14:10:36 GMT
Server - Apache/1.3.26 (Unix) mod_jk/1.2.0 mod_perl/1.27 PHP/4.2.2 mod_ssl/2.8.10 OpenS
Set-Cookie - SSOAuthSessionID=52c0975bf42d29333a9572064858167e;path=/;
Location - /homepage.nsf/SolutionsDisplay?OpenForm
referer - /dologin
Connection - close
Content-Type - text/plain
null - null
null - null
null - null
Please enjoy this holographic presentation of our apocalyptic dilemma right after this tiny ad:
a bit of art, as a gift, the permaculture playing cards
    Bookmark Topic Watch Topic
  • New Topic