Re: Using Java to supply username and password to login to a web site

From: Amit (amitshettyg_at_hotmail.com)
Date: 10/20/03


Date: 20 Oct 2003 08:03:14 -0700

Chris Smith <cdsmith@twu.net> wrote in message news:<MPG.19fa15acd99503139896f9@news.pop4.net>...
> Amit wrote:
> > Using Java, I want to supply my username and password to login to a
> > web site and manipulate the data on that site. Any suggestions?
>
> Can you provide more information about the web server? Is it expecting
> a form login? HTTP basic authentication? HTTP digest authentication?
> If it's not form login, then you can send an unauthenticated request,
> and get the type of authentication required back from the response
> headers. Form login is not designed to be accessible to machines, and
> requires human intelligence to figure it out from scratch, so you'd need
> to build in some knowledge (particularly, the names of the various
> fields).

Chris, Thanks for the reply.

What I am trying to do is to retrieve and save a page from a website.
The website has a login page which is a form. When I type the url for
any page, it returns the login page. i want to send the username and
password using my Java program, so that it will return the actual
page, rather than the redirected login page. Is it possible to submit
the login form and then access the required page.
>
> Incidentally, if you want to do the HTTP auth bit in a long-term
> maintainable way, I'd take a good strong look at HttpClient from Jakarta
> Commons and abandon URLConnection immediately (assuming you were looking
> at it in the first place).



Relevant Pages

  • Re: Auto-authenticate Domain Users through ASP?
    ... To get the NT username, ... turn off Anonymous Access on your Web site (either manually using IIS Admin ... will be presented the ugly login box. ...
    (microsoft.public.inetserver.iis.security)
  • Re: application can access by login in web site
    ... username and password (login) ... this username and password is not for proxy, ... the web site. ... http://mindprod.com Java custom programming, consulting and coaching. ...
    (comp.lang.java.help)
  • How to create a login page on web site
    ... Within the web site, I created a web page with a login (username, ... files for the authorized users. ...
    (microsoft.public.frontpage.programming)
  • a security issue, feedbacks welcome
    ... I'm creating a web site where users must login to access to secured part of ... each person's name on this list is their login name... ... username with the users Id in aspnet_Users table..... ... Jeff ...
    (microsoft.public.dotnet.framework.aspnet)
  • Problem handling Login control Authenticate event
    ... login process. ... required for login… they have a username, password, and another “location ... and when the extra input field is submitted ... for the users where this concatenation of the two input field ...
    (microsoft.public.dotnet.framework.aspnet)