users@jersey.java.net

HTTP Basic Authentication (header encoding)

From: Rabick, Mark A (IS) <"Rabick,>
Date: Thu, 30 Apr 2009 16:26:54 -0500

Does anyone have a code snippet for creating the Base64 encoded user/password combination for a Jersey server configured for BASIC authentication?

In the Jersey client code, is it just:

nodeBaseResource.header("Authorization", "base64encoded_userid:password").type("application/xml").post(nodeV1);

... for a post request?

--mark
_______________________________________________
Mark A. Rabick
Software Engineer
Northrop Grumman - Integrated Mission Systems (IS/DSD/IMS)
3200 Samson Way
Bellevue, NE 68123
Ph: (402) 293-7091
Em: mark.rabick_at_ngc.com
Remember PFC Ross A. McGinnis...
  http://www.army.mil/medalofhonor/McGinnis/index.html
... MA2 Michael A. Monsoor, Lt. Michael P. Murphy, Cpl. Jason Dunham, SFC Paul Ray Smith and the rest...
  http://www.cmohs.org/recipients/most_recent.htm