Using the DefaultHttpClient I have implemented the SSL connection factory and I want to send preemptive basic authentication headers using Spring Rest Template for Android. The problem is the header is not sent, never. If I use a Spring application using Rest Template, the HttpClient will be > 4.0.3 (Android version) and the authentication header is sent, without any complication whatsoever. But in Android it is never sent.
I have tried using Interceptors and setting the credentials in the HttpClient like described in Preemptive Basic authentication with Apache HttpClient 4 but it does not work.
Maybe if I use HttpURLConnection I can achieve the SSL and the preemptive basic auth. If there is no solution for the current implementation I have with DefaultHttpClient with RestTemplate, then is it possible to use HttpURLConnection? How?
Aucun commentaire:
Enregistrer un commentaire