BlackBerry Forums Support Community
              

Closed Thread
 
LinkBack Thread Tools
Old 07-15-2008, 01:52 AM   #1 (permalink)
Knows Where the Search Button Is
 
Join Date: Apr 2008
Model: 7100T
PIN: N/A
Carrier: optus
Posts: 24
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Handset application Authenticator Proxy settings.

Please Login to Remove!

Hi guys,

I have an application that makes a http connection to a server, this works fine. The connection now must be made to a server that is behind a proxy. I've read in java you can use the Authenticator class to handle this. There are a few examples here and here.

My Code:
Code:
ProxyAuthenticator() { 
this.user = "user"; 
this.password = "test";
}

  public PasswordAuthentication 
  onAuthenticationChallenge(String description, boolean isUserIdRequired, boolean isFullAccess) {
    return new PasswordAuthentication(user.getBytes(), password.getBytes());
  }
  public byte[] onAuthenticationResponse(byte[] userName) {return null;}
}
The problem seems to be that in the Blackberry environment, you can't tell the sytem what to do when it is queried by a proxy:


Code:
//and put these lines of code before your code opens an URLConnection-

Authenticator.setDefault(new ProxyAuthenticator("user", "password"));
System.setProperty("http.proxyHost", "proxy host");
System.setProperty("http.proxyPort", "port"); 

//Now all calls will successfully pass through the proxy authentication.
Can anyone tell me what you have to do to 'register' your authenticator implementation with the system?
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

10x 6mm Shaft Hole Dia Plastic Threaded Knurled Potentiometer Knobs Caps NB
$0.95
10x 6mm Shaft Hole Dia  Plastic Threaded Knurled Potentiometer Knobs Caps NB picture1pc Miniature Dual 50k Audio Taper Stereo Thumbwheel Potentiometer PCB Mount NEW
$2.99
1pc Miniature Dual 50k Audio Taper Stereo Thumbwheel Potentiometer PCB Mount NEW picture1K 2K 5K 10K OHM Linear Taper Rotary Potentiometer Pot 3 Sets Gadgets
$2.29
1K 2K 5K 10K OHM Linear Taper Rotary Potentiometer Pot 3 Sets Gadgets picture5Pcs Ribbed Grip 4mm Split Shaft Potentiometer Control Knobs Grey Ev
$0.99
5Pcs Ribbed Grip 4mm Split Shaft Potentiometer Control Knobs Grey Ev picture10 Pcs Black Silver Tone 19mm Top Rotary Knobs for 6mm Dia. Shaft Potentiometer
$8.61
10 Pcs Black Silver Tone 19mm Top Rotary Knobs for 6mm Dia. Shaft Potentiometer picture






Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.