Not working with latest Retrofit and OKHttp?
Informaticore opened this issue · 0 comments
Informaticore commented
Hey I am trying your implementation. But the OkHttpClient does not have a function called client.setAuthenticator(new CachingAuthenticatorDecorator(authenticator, authCache));?
Am I missing something? Or does it not support the newest version of OKHttp?
I am using compile 'com.squareup.retrofit2:retrofit:2.2.0'
and try to set the Client like:
`OkHttpClient httpClient = new OkHttpClient();
final DigestAuthenticator authenticator = new DigestAuthenticator(new Credentials("username", "pass"));
final Map<String, CachingAuthenticator> authCache = new ConcurrentHashMap<>();
httpClient.interceptors().add(new AuthenticationCacheInterceptor(authCache));
httpClient.authenticator().add(new CachingAuthenticatorDecorator(authenticator, authCache)); //this line is not working
Retrofit.Builder retrofitBuilder = NetworkHelper.create().retrofit();
retrofitBuilder.client(httpClient);
Retrofit retrofit = retrofitBuilder.build();`