Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Posts: 39
Registered: ‎07-18-2008
My Device: Not Specified

Authenticator proxy connection.

Hi guys, I have an application that needs to communicate via a proxy, I use the following code to implement the Authenticator class:



private class SendThread extends Thread implements Authenticator { private String user, password; SendThread(String url) { //Proxy user name and password this.user = "fake"; this.password = "fake"; this.url = url; } //Authenticator implemented methods to handle proxy challenge/request. public PasswordAuthentication onAuthenticationChallenge(String description, boolean isUserIdRequired, boolean isFullAccess) { return new PasswordAuthentication(user.getBytes(), password.getBytes()); } public byte[] onAuthenticationResponse(byte[] userName) { return null; } connection = (StreamConnection)Connector.open(url);

httpConn = (HttpConnection)connection;

... }



I can't test this at the moment as it was made for a clients enviornment. It doesn't seem to be working, has anyone else tried this/can see what might be wrong?