To make this work:
context = new BasicHttpContext(); context.setAttribute(ClientContext.AUTH_SCHEME_PREF, Arrays.asList(OAuthSchemeFactory.SCHEME_NAME)); client = new DefaultHttpClient(); client.getAuthSchemes().register(OAuthSchemeFactory.SCHEME_NAME, new OAuthSchemeFactory()); client.getCredentialsProvider().setCredentials(new AuthScope("server.com", 80), new OAuthCredentials(accessor)); client.getParams().setParameter(OAuthSchemeFactory.DEFAULT_REALM, ProtectedResource.REALM); client.addRequestInterceptor(new PreemptiveAuthorizer(), 0);@author John Kristian
|
|
|
|
|
|
|
|
|
|
|
|