Consultor Eletrônico



Kbase P3735: How to specify SonicMQ a user name and password for the prox
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   8/20/2003
Status: Unverified

GOAL:

How to specify SonicMQ a user name and password for the proxy server's
authentication.

FACT(s) (Environment):

SonicMQ 4.x

CAUSE:

Currently not supported

FIX:

In SonicMQ 4.0 there should be two different ways for the user to accomplish this themselves:

1. One method of dealing with the proxy server challenge is to
specify a Proxy-Authorization header field in the requests.
We do allow users to specify "custom" HTTP request headers,
so they can provide it this way.

To do this, they would need to set a system property for us
prior to opening
String username = <username>
String password = <password>;
// the value must get base64 encoded, and the user will need
// to locate a method to do this - but they should not be too
// hard to find.
String encodedAuth = base64Encode( username + ":" + password );
System.setProperty( "HTTP_CUSTOM_HEADER_1", "Proxy-Authorization");
System.setProperty( "HTTP_CUSTOM_HEADER_VALUE_1", encodedAuth );

If this is done prior to creating any SonicMQ JMS connections, the
HTTP Header to satisfy the challenges should be included with the
request.

2. The other method seems cleaner, but looks like additional work
for the user.

Because we have switched to using the HttpURLConnection class
instead of the third party (HTTPClient) package, the user should be
able to provide their own java Authorization class for URLConnections
to use.

The O'Reilly Java Network Programming has a section on this. There
is also a JavaWorld "Java Tip" at
http://www.javaworld.com/javaworld/javatips/jw-javatip46_p.html
that can help.