mtalpe / nctoolbox

Automatically exported from code.google.com/p/nctoolbox
0 stars 0 forks source link

Access of password protected thredds server #32

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I'm trying to access a password protected server with ncgeodataset and it fails 
miserably... Ideas?

What steps will reproduce the problem?
1. >> 
url='https://tarod.cmima.csic.es:8443/thredds/dodsC/L3OS1b/SM_OPER_M___OFCEF5_20
110527T120000_20110530T120000_201_001_1.nc';
2. >> nc=ncgeodataset(url);

What is the expected output? What do you see instead?
I get:
Error in ==> ncgeodataset>ncgeodataset.ncgeodataset at 20
            obj = obj@cfdataset(url);

Caused by:
    Java exception occurred:
    java.io.FileNotFoundException:
    https:/tarod.cmima.csic.es:8443/thredds/dodsC/L3OS1b/SM_OPER_M___OFCEF5_20110527T120000_20110530T120000_201_001_1.nc
    (No such file or directory)

What version of the product are you using? On what operating system?
nctoolbox-20100223  on a MAC 

Original issue reported on code.google.com by alfredo....@gmail.com on 11 Jan 2012 at 8:34

GoogleCodeExporter commented 8 years ago
Looks like we needed to add a CredentialProvider (from HttpClient). I've added 
a new Matlab function named setpassword that should allow you to set a username 
and password for accessing password protected servers. Unfortunately, I don't 
have a server to test it against.

If you want to try it out right away do the following:
1) Download BasicCredentialsProvider.class (attached) and copy it ito 
nctoolbox/java
2) Download setpassword.m (attached) and copy it into nctoolbox/cdm/utilities

If you try it out, would you let me know whether or not it works? Thanks

These files will be included in the next release of nctoolbox. The change set 
containing the fix is at 
http://code.google.com/p/nctoolbox/source/detail?r=fbfc82e4b415894a5abda6ada12a0
a6cc29a453b

Compiled BasicCredentialsProvider with: javac -cp 
/Users/brian/.m2/repository/commons-httpclient/commons-httpclient/3.1/commons-ht
tpclient-3.1.jar BasicCredentialsProvider.java 

Original comment by bschlin...@gmail.com on 11 Jan 2012 at 9:14

Attachments:

GoogleCodeExporter commented 8 years ago
Hey Brian, Alfredo & I don't know java.  Can you please provide a jar file?

Original comment by rsignell on 11 Jan 2012 at 10:32

GoogleCodeExporter commented 8 years ago
Rich, You don't need a jar file. Just drop BasicCredentialsProvider.class into 
nctoolbox/java. (You'll need to restart Matlab if it's already running.)

Note: BasicCredentialsProficer.java (note the .java extension) is the source 
code; you don't need that. BasicCredentialsProvider.class (note the .class 
extension) is the compiled code; that's the file to use.

Original comment by bschlin...@gmail.com on 11 Jan 2012 at 10:37

GoogleCodeExporter commented 8 years ago
Was anyone able to test the 'setpassword' function?

Original comment by bschlin...@gmail.com on 23 Jan 2012 at 5:41

GoogleCodeExporter commented 8 years ago
Rich, did you or Alfredo test this?

Original comment by bschlin...@gmail.com on 30 Jan 2012 at 4:48

GoogleCodeExporter commented 8 years ago
Rich did this end up working?

Original comment by crosb...@gmail.com on 21 Jun 2012 at 4:10

GoogleCodeExporter commented 8 years ago
I seem to recall I tried and failed -- wasn't sure exactly what I was supposed 
to do though.

Original comment by rsignell on 21 Jun 2012 at 5:41

GoogleCodeExporter commented 8 years ago
I have confirmation from MBARI staff who've used 'setpassword' that it works 
(at least for the site they were accessing)

Original comment by bschlin...@gmail.com on 5 Nov 2012 at 11:50

GoogleCodeExporter commented 8 years ago

Original comment by bschlin...@gmail.com on 6 Nov 2012 at 5:02