Welcome!

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

Reply
Regular Contributor
milan555
Posts: 52
Registered: ‎07-04-2011
My Device: Bold-3

HTTP response code : 401

Hello,

 

I have some issue in that I can not understand.

I got HTTP response code 401 when I tried to authenticate.

I entered the right username & password thought I got 401.

While I used the same password & username in other device I got perfect response.

So, it is hard to me to understand what was the issue?

Is there any issue regarding Wifi / BES / BIS ?

Is any possibility that BES server has blocked the URL ?

 

If anyone has any answer please suggest your idea.

 

Thanks.,

 

 

 

Developer
peter_strange
Posts: 19,609
Registered: ‎07-14-2008
My Device: Not Specified

Re: HTTP response code : 401

Have a look at this:

http://supportforums.blackberry.com/t5/Java-Development/Implement-basic-HTTP-authentication/ta-p/445...

 

Note:

 

You have a number of outstanding questions that I'm guessing are probably solved, since you are no longer posting on them.  Can you please go through these and mark up the solutions.  Thanks.

 

To save you looking, here are some of them:

http://supportforums.blackberry.com/t5/Java-Development/Response-code-505/m-p/2078077#M213679

http://supportforums.blackberry.com/t5/Java-Development/Download-image-in-custom-list/m-p/2067697#M2...

http://supportforums.blackberry.com/t5/Java-Development/Lazy-Loading/m-p/2060807#M213499

Regular Contributor
milan555
Posts: 52
Registered: ‎07-04-2011
My Device: Bold-3

Re: HTTP response code : 401

[ Edited ]

Thanks for reply,

 

I go through your posted link.

I have tested my code regarding authentication, it worked on so many devices, issue came on only one device, may be in that device we use Enterprise Server for connection , so just want to know how to resolve that issue ?

But on those threads still I did not get solutions,so I did not mark  them as solutions.

 

Regards,

 

Developer
peter_strange
Posts: 19,609
Registered: ‎07-14-2008
My Device: Not Specified

Re: HTTP response code : 401

There is a trick with BES.  Even if you know that your request is going to require a login, you can not supply the basic authentication header until it is actually requested.  So do not supply it on the first request, wait for the BES to come back with a 401 and then connect again supplying it.  The KB article I pointed you at demonstrates code that does this.  I suspect that is the problem you are having. 

 

"But on those threads still I did not get solutions,so I did not mark  them as solutions."

May be not, but those Threads are waiting for input from you and have been for some time.  If you can't get a solution from the input so far perhaps you should try something or ask another question?  Or are you still working on them? 

Regular Contributor
milan555
Posts: 52
Registered: ‎07-04-2011
My Device: Bold-3

Re: HTTP response code : 401

OK.

Yes, I am still working on those threads.

 

Regards,