Re: [thredds] java opendap basic authentication


  Thanks for quick reply.   I only did some hacking  (I used to work for
Hacker, Peter the Great-:)

here is what I did on

< import org.apache.commons.httpclient.HttpMethod;
< import org.apache.commons.httpclient.methods.GetMethod;
< import org.apache.commons.httpclient.HttpClient;
< import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager;
< import org.apache.commons.httpclient.HttpMethod;
< import org.apache.commons.httpclient.Header;
< import org.apache.commons.httpclient.auth.AuthScope;
< import org.apache.commons.httpclient.UsernamePasswordCredentials;
< import org.apache.commons.httpclient.methods.HeadMethod;
<     _httpClient.getState().setCredentials(
<                      new AuthScope("hostname",80),
<                      new UsernamePasswordCredentials("user", "passwd"));
<     Authenticator.setDefault(new MyAuthenticator.MAuthenticator());
<     Authenticator.setDefault(new MyAuthenticator.MAuthenticator());
<     method.setDoAuthentication( true );

Similar thing to

On Tue, Sep 28, 2010 at 2:41 PM, Dennis Heimbigner <dmh@xxxxxxxxxxxxxxxx>wrote:

> Can you send your changes (or the complete files)
> to me at dmh@xxxxxxxxxxxxxxxx? I want to see what you did.
> =Dennis Heimbigner
>  Unidata
> Ying at NCCS wrote:
>> Hi John,
>>  Sorry if this is not the right place to post this message.
>>  I have problem to use netcdf java (along with opendap.jar etc) to access
>> a remote data (via opendap) that requires basic authentication.   Basic
>> authentication does not provide security to the dataset ---but just a sort
>> of limitation for public access.  For example, a group researchers want to
>> share datasets that are still under QC, and they certainly want to make sure
>> it is not perceived as data product for all.   Anyway popular data analysis
>> software like GrADS and Ferret can all handle URL like http://usr:pass@...
>>  to read data.  And that was the way I set up servers while I was in Hawaii.
>>   Right now, using matlab (if it calls use netCDF java lib) application and
>> GISS Panoply can not read opendap that requires basic authentication.    It
>> seems to me that  opendap-2.2.jar (by OPENDAP group) and netcdf-4.2.jar (by
>> UNIDATA group) (specifically opendap.dap.DConnect2 and
>> ucar.nc2.dataset.NetCdfDataset ) need basic authentication credential
>> enabled.
>>  I have fixed the problem but it is rather ugly -:) for distribution.  I
>> wonder if you developers can put this feature in your development or if
>> there is any tip to share with me that it can be handled in the main method
>> (like to create a static httpClient object that can take care all the
>> authentication challenge all the way down to the lib.
>>  Many thanks..
>> ------------------------------------------------------------------------
>> _______________________________________________
>> thredds mailing list
>> thredds@xxxxxxxxxxxxxxxx
>> For list information or to unsubscribe,  visit:
  • 2010 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the thredds archives: