HTTP authentication problem: Incorrect Base64 Encoding
608823Nov 15 2007 — edited Nov 15 2007Using BPEL Process Manager 10.1.3.1, I created a BPEL process to invoke a web service as a partnerLink. The web service requires authentication on the HTTP level so I added these descriptor properties to the partnerLink using JDeveloper:
<property name="wsdlLocation">OrderManagementWSRef.wsdl</property>
<property name="basicUsername">oms_admin</property>
<property name="basicPassword">oms_admin</property>
<property name="basicHeaders">credentials</property>
Then I captured the HTTP messages. Here is the header of the request:
POST /osm/wsapi HTTP/1.1
Host: srvtodev08:7070
Connection: TE
TE: trailers, deflate, gzip, compress
User-Agent: Oracle HTTPClient Version 10h
SOAPAction: "http://xmlns.oracle.com/communications/ordermanagement/CreateOrderBySpecification"
Accept-Encoding: gzip, x-gzip, compress, x-compress
Authorization: Basic bnVsbDpudWxs
Content-type: text/xml; charset=UTF-8
Content-length: 753
For the HTTP response, I got
HTTP/1.1 401 Unauthorized
Then I checked the log of the weblogic server hosting the web services. It said the user null had invalid login attempts.
What I found out using a base64 coding program is that the HTTP request sends the credential
Authorization: Basic bnVsbDpudWxs
was decoded as null:null. That's why the null user on weblogic log. The credential I used, oms_admin:oms_admin should be encoded as b21zX2FkbWluOm9tc19hZG1pbg==.
How do I make BPEL to encode the credential properly? I have also tried entering the username and password on the Initiate BPEL Process web page and using the descriptor properties httpUsername and httpPassword but the authorication header field of the HTTP request is always the same.
Ted