Skip to content
This repository has been archived by the owner on Sep 1, 2022. It is now read-only.

HTTPSession documentation #176

Open
rschmunk opened this issue Sep 9, 2015 · 2 comments
Open

HTTPSession documentation #176

rschmunk opened this issue Sep 9, 2015 · 2 comments
Assignees

Comments

@rschmunk
Copy link
Contributor

rschmunk commented Sep 9, 2015

A commit back in early July removed the method

ucar.httpservices.HTTPSession.setGlobalCredentialsProvider(CredentialsProvider)

Unfortunately, the HTTPSession documentation in the reference pages at netcdf-java/reference/Session.html still refers to using this method, so need to be updated.

I bring this up because I have been using this method, so need to figure out a replacement in order to use the new NJ 4.6.3 release. As a first step, I have tried replacing the call by using

HTTPSession.setGlobalCredentialsProvider (AuthScope.ANY, myCredentialsProvider)

but that throws an exception

java.lang.IllegalArgumentException: null argument
at ucar.httpservices.HTTPSession.setGlobalCredentialsProvider(HTTPSession.java:443)

because the AuthScope.ANY.getScheme() method returns null.

@rschmunk
Copy link
Contributor Author

Following up on this because the recently committed 4.6.4 seems to have switched things back in terms of what the functionality I was using.

I had replaced HTTPSession.setGlobalCredentialsProvider(CredentialsProvider) with HTTPSession.setGlobalCredentialsProvider(CredentialsProvider, HTTPAuthSchemes.ANY)
but 4.6.4 seems to have wiped out the existence of ucar.httpservices.HTTPAuthSchemes.

Calling HTTPSession.setGlobalCredentialsProvider(CredentialsProvider) now seems to work again, so I will use that. Looks like this was the result of Dennis's commit on Jan 11 in response to issue 365.

@DennisHeimbigner
Copy link
Contributor

Correct. The issue was that we needed to upgrade to properly use Apache HttpClient library version 4.5. The apache people made (IMO) a serious mistake in making significants mods to the API right in the middle of the 4 versions rather than moving to, say, version 5. The result was that we were using Apache version 4.5 and getting a large number of deprecations. Moving to properly use Apache 4.5 required a lot of changes, expecially in adapting to their immutable model and in handling authorization. Some things became simpler, some more complicated. In any case, sorry about any inconvenience. I hope that the current apache API remains stable, but no guarantees with these guys.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants