Create an account | Log in | Password | Contact Contact us

365 projects | 71 services | 215 websites | 1132 freelancers | 2889 topics | advertise


Purchase JoomlaWatch:
30 day money-back guarantee
Read more...
9 EUR lifetime license
Buy JoomlaWatch Now

15 EUR lifetime license
Buy JoomlaWatch Now
(nofollow link from sponsors page)

Extension directory rating:
rating 4.47 rating 4.47 rating 4.47 rating 4.47 rating 4.47
4.47

Login:

ExtraWatch Agent
About JoomlaWatch:
JoomlaWatch is realtime analytics website traffic tracker to watch and track users and evaluate stats, online visitor hit counter. It provides several features such as spam blocking, goals tracking, charts, nightly email reports, latest visit map, interactive HTML5 traffic flow graph and many other useful functionalities, which will help you to optimize your site.

This website also offers variety of free joomla templates for download
RSS Feeds:

Freelance profiles Freelance
Open freelance projects Projects
Joomla and JoomlaWatch forum Forum
Best programming websites Resources

Home

Forum for users of Joomla and JoomlaWatch

Welcome, Guest
Please Login or Register.    Lost Password?

Authentication in JAVA
(1 viewing) (1) Guest
Go to bottomPage: 1
TOPIC: Authentication in JAVA
*
#2307
Authentication in JAVA 2 Years, 4 Months ago Karma: 0
Hello,

I have a big problem. I want to use java to authenticate on secured websites. I took Yahoo Answers Website as an example. I made the post request, but , instead of redirecting me to the page it supposes to , it redirects me to a page saying my browser rejected cookies. I'm setting user-agent as IE 7.0, and in my IE browser, I set to accept all cookies.


Please help, I need your help ASAP!


Thank you very much,


Octavian<br><br>Post edited by: tavy88, at: 2009/12/26 05:36
tavy88 (User)
Fresh Boarder
Posts: 4
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#2308
Re:Authentication in JAVA 2 Years, 4 Months ago Karma: 27
Hi tavy88,
your post is quite confusing. You said you want to authenticate using java, and then you write you are using internet explorer. If you meant it the way that you have a program in java which creates this POST request, and has a user-agent set to internet explorer, then yes, the server may refuse you because your simple java client isn\\\'t really accepting the cookies.

Why don\'t you try to use libraries like httpunit, h ttp://httpunit.sourceforge.net/ or HTTPClient : h ttp://www.innovation.ch/java/HTTPClient/ which should also support HTTPS.

Cheers, Matto<br><br>Post edited by: matto, at: 2009/12/26 16:28
matto (Admin)
Moderator
Posts: 745
graph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#2310
Re:Authentication in JAVA 2 Years, 4 Months ago Karma: 0
Hello, Sir


Yes, I use HttpClient classes and yes I set the user-agent to IE. I thought if I set security in the IE browser, it may help.It didn't. I also printed out the headers of my server response, and I see there the cookies ok, but, the &quot;Location:&quot;, if I copy and paste in a browser, it takes me to a page saying : &quot;Your browser rejected your cookies and refuses to sign in&quot;.


Please, can you help me?


Regards,

Octavian
tavy88 (User)
Fresh Boarder
Posts: 4
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#2315
Re:Authentication in JAVA 2 Years, 4 Months ago Karma: 27
I'm not that much familiar with this set of classes, but it seems that there is a separate module for handling the cookies:

h ttp://www.innovation.ch/java/HTTPClient/advanced_info.html
(section CookieModule)

Cite:

&quot;This module implements cookies as defined by Netscape's cookie spec and the latest HTTP State Management Mechanism spec. During response processing it intercepts and parses the Set-Cookie and Set-Cookie2 header fields (removing them from the response in the process), and during request processing it adds all eligible cookies to the requests.

Because of privacy issues surrounding cookies, whenever the server tries to set a cookie a policy handler is invoked to see whether this cookie should be accepted. The default handler brings up a popup describing the cookie and allowing the user to accept or reject it; the user may also summarily accept or reject cookies from whole domains. You may substitute your own policy handler using the setCookiePolicyHandler() method. If you set the handler to null then all cookies will be silently accepted. If you do not want any cookies to be accepted then either remove the CookieModule from the list of modules or set your own handler which always returns false. The handler must implement the CookiePolicyHandler interface. &quot;


So it means that you probably have to use the setCookiePolicyHandler(null) so all cookies will be accepted. Later you should probably write your own handler.
matto (Admin)
Moderator
Posts: 745
graph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#2316
Re:Authentication in JAVA 2 Years, 4 Months ago Karma: 0
Yes I know that, and I tried it but with no luck. I also looked at your HttpUnit classes, and from FAQ I see they have big problem with ssl communication, so I guess it won't help me either.

What can I do? Can't Java handle this tiny thing? I hear C# has a class too that does it all. Is Java weaker than C#? Please need an urgent solution in Java.
tavy88 (User)
Fresh Boarder
Posts: 4
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#2317
Re:Authentication in JAVA 2 Years, 4 Months ago Karma: 27
I don't think it's because Java is weak or something. This is a problem which is quite common and you just need to find out why it doesn't work in your case.

Regarding HttpClient (not HttpUnit), I see there is a support for SSL:
h ttp://hc.apache.org/httpclient-3.x/sslguide.html

so there should be no problem with it at all. Maybe posting your code would help.
matto (Admin)
Moderator
Posts: 745
graph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#2318
Re:Authentication in JAVA 2 Years, 4 Months ago Karma: 27
You can also try to run the code from the section Troubleshooting on the mentioned page:

Troubleshooting
The application below can be used as an ultimate test that can reliably tell if SSL configured properly, as it relies on a plain socket in order to communicate with the target server. If an exception is thrown when executing this code, SSL is not correctly installed and configured. Please refer to Sun's official resources for support or additional details on JSSE configuration.
matto (Admin)
Moderator
Posts: 745
graph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#2321
Re:Authentication in JAVA 2 Years, 4 Months ago Karma: 0
Can I send it to your e-mail. I can't post it here due to the rules against links.
tavy88 (User)
Fresh Boarder
Posts: 4
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#2644
Re:Authentication in JAVA 1 Year, 11 Months ago Karma: 0
Hi thanks for that information that's helpful!!!!
orangewine6 (User)
Fresh Boarder
Posts: 1
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#3339
Re:Authentication in JAVA 5 Months, 3 Weeks ago Karma: 0
how can i get orders or bids so that i work on them
JUSTICEGUYA (User)
Fresh Boarder
Posts: 1
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#3530
Re:Authentication in JAVA 1 Month, 4 Weeks ago Karma: 0
thank you, that helped me a lot
galenvorgr (User)
Fresh Boarder
Posts: 3
graphgraph
User Offline Click here to see the profile of this user
Gender: Male Birthday: 01/23
The administrator has disabled public write access.
 
Go to topPage: 1



Recommended:
Joomlawatch 1.2.17 Demo (PRO: 9/15 EUR)
Download Joomlawatch 1.2.17 (PRO: 9/15 EUR)

JoomlaWatch demo

Watch and track joomla 2.5 users and evaluate stats

Front page | Admin

Watch and track joomla 1.5 users and evaluate stats

Front page | Admin

Watch and track wordpress users and evaluate stats

Front page | Admin

Watch and track drupal users and evaluate stats

Front page | Admin


We have now:
we have now pagerank 7 !


Stay in touch:

Fixed problem with initializaton of javascript functions of JW. It was caused by file permission restrictions of some hosting providers

Fixed update mechanism for version 1.2.17 PRO - Joomla will now download of latest version of JoomlaWatch for you !

Fixed JoomlaWatch 1.2.18 BETA update mechanism for Joomla 2.5

Updated the customer zone files. There's the latest ExtraWatch PRO BETA available for download, confirmed to work with Joomla 2.5.4

@websupport_sk noo, hlavne ze ho uz mate niekde nad Afrikou :)) ten Zlin asi nehrozi

Fixed Warning: session_start() [function.session-start]: Cannot send... on latest Joomla 2.5.2 (Free/PRO version)

Free ExtraWatch now available on wordpress plugin directory: (link)

JoomlaWatch for Wordpress now on demo server: (link) (frontend) (link) (backend)

JoomlaWatch is going to be re-branded. New name will be introduced to you soon :) It has an universal name not dependent on any CMS

JoomlaWatch published back again on (link) I still can't cope with their support to their long-term contributors & supporters

The reason why you can't find JoomlaWatch on JED is that they unpublished it due to some strange reasons and don't even react on tickets...

Another article about JoomlaWatch Component / Module directory sizes and trends (link)

Next article on JoomlaWatch Database Status Report and Trends: (link)

(link) has now GOOGLE PAGERANK 7 !!! :) My thanks to everyone for support

New article on JoomlaWatch Nightly Email reports: (link)

Another 2 new articles published: JoomlaWatch History : (link) + Anti-spam and Blocking: (link)

New professional article about JoomlaWatch Graphs & Trends: (link)

JoomlaWatch for drupal available here: (link) username: demo password: demo

New online JoomlaWatch demo available here: (link)

New comprehensive article on JoomlaWatch goals: (link)



Partners:
Freelance ColdFusion, Flex, PHP

Olejomalby, abstraktne obrazy

Camping Europe

WinAsm Studio

Vyšné Ružbachy

Sochy, Reštaurovanie

R.E.M.

Valid XHTML 1.0 Transitional

RSS feed:

Statistics:
Visitor map
Site map | Donate




© Copyright 2003-2012 Codegravity.com