This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
I need to create a java class which can do the following requirement.
- When the openid and the password is given it should create and HttpRequest and send to the https://www.myopenid.com/signin_password page and get the authResponse which has the openid token.
- I need to do accomplish the above task without using a browser.
How can i accomplish my task. A sample code would be much appreciated.
But a small problem.
When i write URLConnection uRLConnection = new URLConnection(url) it gives and error saying that all abstract methods are not implemented.
When i click the suggestion button and click implement all abstract methods its shows something like this.
What does that mean? What's the server response? Post the HTTP status code and the body of the response.
You can also use a tool like tcpmon to observe the HTTP that gets sent to the server, and compare it to what gets sent if you access that site from within a browser.
Hemal Mahagederawatte
Greenhorn
Joined: Dec 17, 2008
Posts: 16
posted
0
I said i don't get authenticated because after I run my code and went to the https://www.myopenid.com/signin_password it asks for my username and password. If I was successfully authenticated when i run my code it shouldn't be asking like that. Isn't it?
The form on that page submits to https://www.myopenid.com/signin_submit, not the URL you're using. And it uses form parameters, not basic authentication.
I though it's not possible to directly send request to the https://www.myopenid.com/signin_submit. Because if you do it in the browser it will give the following message
Error
You have followed a bad link. Please inform the owners of the site from which you came.
Any way can you give me any suggestion on how to authenticate.
But it returns the index page not the page that should be get if it is successfully authenticated.
In the example that is in the http://www.exampledepot.com/egs/java.net/Post.html it uses http. In my scenario it is a https connection. Does some additional thing to be done when you are posting to a https connection.