BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 07-15-2008, 01:52 AM   #1
skynetchris
Knows Where the Search Button Is
 
Join Date: Apr 2008
Model: 7100T
PIN: N/A
Carrier: optus
Posts: 24
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



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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


Zworld Micro Processor picture

Zworld Micro Processor

$150.00



Intel Core i5-13500 Socket 1700 14 Core Desktop CPU SRMBM 2.5GHz - 4.8GHz picture

Intel Core i5-13500 Socket 1700 14 Core Desktop CPU SRMBM 2.5GHz - 4.8GHz

$160.00



NEC V20 CPU 8088 Upgrade D70108D-8 NOS Ceramic, Processor 8 mhz, NOS, USA STOCK picture

NEC V20 CPU 8088 Upgrade D70108D-8 NOS Ceramic, Processor 8 mhz, NOS, USA STOCK

$19.99



ALLEN BRADLEY 1756-LSP B GUARDLOGIX 55LSP PROCESSOR  F/W REV. 2.1 picture

ALLEN BRADLEY 1756-LSP B GUARDLOGIX 55LSP PROCESSOR F/W REV. 2.1

$45.00



New Siemens 6ES7-214-1AG40-0XB0 6ES7 214-1AG40-0XB0 SIMATIC S7-1200, CPU 1214C picture

New Siemens 6ES7-214-1AG40-0XB0 6ES7 214-1AG40-0XB0 SIMATIC S7-1200, CPU 1214C

$195.00



NEW FACTORY SEALED AB 1747-L541 SER B SLC 500 SLC 5/04 CPU PROCESSOR UNIT MODULE picture

NEW FACTORY SEALED AB 1747-L541 SER B SLC 500 SLC 5/04 CPU PROCESSOR UNIT MODULE

$311.33







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