This week's book giveaway is in the Server-Side JavaScript and NodeJS forum.
We're giving away four copies of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques and have Mario Casciaro & Luciano Mammino on-line!
See this thread for details.
Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!
  • 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 ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

programmatic authentication

 
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I have set form-based authentication on Websphere 5.1 and it works ok from the browser. Now I need to connect to the Web Container using a Java client to download protected resources.
The problem is that I cannot see the WASReqURL cookie. I could see the cookie in the browser after I have asked for a protected resource, but not with the Java client:

URLConnection conn = url.openConnection();
Iterator iterator = conn.getHeaderFields().entrySet().iterator();
while (iterator.hasNext()) {
System.out.println(iterator.next());
}

Any ideas?


PS:
Here is what the server returns:

Content-Length=[1526]
null=[HTTP/1.1 200 OK]
Content-Language=[en-US]
Date=[Thu, 24 Nov 2005 12:59:12 GMT]
Server=[WebSphere Application Server/5.1]
Content-Type=[text/html]
last-modified=[Tue, 25 Oct 2005 12:56:25 GMT]
 
Cristian Negresco
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Well, it worked.
Here is the post which solved the pb:
http://www.rgagnon.com/javadetails/java-0092.html.

HttpClient class and usage is to be found here:
http://jakarta.apache.org/commons/httpclient/tutorial.html.

Cristian.
 
I would challenge you to a battle of wits, but I see you are unarmed - shakespear. Unarmed tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic