• Post Reply Bookmark Topic Watch Topic
  • New Topic

login to a https website using java code  RSS feed

 
sam jesse
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I am running java 1.8 under 64 bit windows 7, using the code below I failed to log in, I am getting the log in page but not being logged in.

Would you please help . Many Thanks


 
fred rosenberger
lowercase baba
Bartender
Posts: 12565
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What makes you think there is a problem? How do you know you are not being logged in? Is there an error message? what exactly DOES happen?

My larger point is that you need to TellTheDetails. We can't duplicate your problem, and you've removed the URL, ID and PW (which I don't blame you for doing). So from where we are sitting, it could be a wrong, URL, it could be a wrong password, or about a million other things. Help us help you.
 
sam jesse
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The reason I think I am not logged in is that the page I receive is the same log in page where it asks for the log in username and password and not the "welcome" page where I see my name "confirming that I am logged in".

I made up a muck account in an online forum for testing.
https://www.sydneyforum.com/login
samjesse
123
 
Maxim Karvonen
Ranch Hand
Posts: 121
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Sam.

I suggest using an HTTP monitoring tool. For example, you may use a developer console in Firefox or Chrome. You could see an actual request made by the browser.

As to your problem. You are trying to use HTTP basic authentication. But the site passes login and password as form parameters in the POST request. It also passes other parameters which may or may not matter. you should match browser request as closely as possible first and then you could remove all non-necessary parts from it.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!