Skip to main content

[ot] form authentication with CURL

No replies
Anonymous

sorry the off-topic, but I need that to test my jersey application

I have this JDBC realm configured in my Glassfish, originally used by
a form based authentication of another application:
http://fgaucho.dyndns.org:8080/cejug-classifieds-richfaces/pages/securit...

and now I am trying to call the secure resource with CURL:

This two command works:

curl -c cookies.txt -d "j_username=fgaucho&j_password=test"
http://fgaucho.dyndns.org:8080/cejug-classifieds-richfaces/pages/securit...
curl -v -b cookies.txt -X GET
http://fgaucho.dyndns.org:8080/cejug-classifieds-richfaces/pages/adverti...

Then, I configured the same JDBC realm in my Jersey web-service
descriptors (web.xml and sun-application.xml), but I can't make it
work:

curl -c cookies.txt -d "j_username=fgaucho&j_password=test"
http://fgaucho.dyndns.org:8080/footprint-service/pages/security/j_securi...
curl -v -b cookies.txt -H "Content-Type:application/xml" -H
"Accept:application/json" -X PUT --data-binary @5.xml
http://fgaucho.dyndns.org:8080/footprint-service/user/create

5.xml has an XML with the serialized object ..

disablign security and using curl, it works..

any hint about CURL and form based authentication would be helpful......

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net