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
New Contributor
Posts: 3
Registered: ‎09-14-2010
My Device: Not Specified
My Carrier: T Mobile

Searching for a HTTPS Authentication Example....

Hi All,

 

I am struggling for several days now to do a https connection (not a Basic Authentication!) from my Java application. I am using the 4.5.0 API and I try to access a Web Service running on one of our servers using https. I am on the Simulator (BlackBerry 8300) at the moment.

 

I did https "Basic Authentication" and it works great - but in the final app, "Basic Authentication" is too weak. So I am searching for a Java example how to handle a real http authentication challenge ...?

I have searched Google for several days now - but could find nothing useful? Is there a special secret to know?

 

I did the same app on the iPhone before and had no problem to find a good documentation on how to authenticate - and everything works instantly. This proves to me that our server is running correctly and that I "only" have to find out how to connect using the BlackBerry API....

 

Thanks for any help & regards,

Ralf

 

Developer
Posts: 16,987
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Searching for a HTTPS Authentication Example....

welcome to the support forums.

 

if you use https, why don't you log in to the webservice?

 

blackberry also offers a multitude of encryption algorithms if you want to go this way.

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
New Contributor
Posts: 3
Registered: ‎09-14-2010
My Device: Not Specified
My Carrier: T Mobile

Re: Searching for a HTTPS Authentication Example....

Hi Simon,

 

thx for your reply! I am not shure what you mean with "Log in to the web service"?

The problem is, that our server is (and must) be secured by https (with logon) and it sends an authentication challange to the clients who want to access it. It does this before even one single http request is processed. There is no way to call any service on the server without doing an full featured https logon first.

 

Regards,

Ralf

Developer
Posts: 16,987
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Searching for a HTTPS Authentication Example....

as far as i understand https the client and the server create a secure connection without any user interaction (except when new certificates have to be trusted etc).

http://en.wikipedia.org/wiki/Transport_Layer_Security#How_it_works

 

when you have an https connection you can do whatever you want. basic auth can be used safely as the connection itself is encrypted.

 

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
New Contributor
Posts: 3
Registered: ‎09-14-2010
My Device: Not Specified
My Carrier: T Mobile

Re: Searching for a HTTPS Authentication Example....

[ Edited ]

Hi,

 

thx for your reply. Unfortunately I can not switch to Basic Authentication on our servers. We are a large company and I can not decide the security settings on our systems.

I am still struggeling by doing more than Basic Authentication with Java2 ME and the API that are available on the BlackBerry. A simple suggestion wether Authentication using Autentication Challenges is in general possible or not on BB would be time saving and very helpful....

 

However, I will continue to search on Google - but the fact that Google finds near to nothing on this topic makes me believe that there is no way. I am afraid that this will kick BlackBerry out of the game.

 

Thx again,

Ralf

New Contributor
Posts: 4
Registered: ‎04-05-2011
My Device: Curve 8520
My Carrier: Software engineer

Re: Searching for a HTTPS Authentication Example....

Hi, Ralf.

I am trying to use Basic authentication and HTTPS to connect to a RESTful web service but I can't even get the connection work! I've checked the URL, the HTTP method (GET in this case), the credentials are OK and the encoding too. Could you share the code you've implemented, so I can eventually get any idea of where I am going wrong?

 

Thanks in advance,

Pedro