Re: [netcdfgroup] nccopy and redirect - based authorization

  • To: "ashwin .D" <winash12@xxxxxxxxx>
  • Subject: Re: [netcdfgroup] nccopy and redirect - based authorization
  • From: Antonio S. Cofiño <cofinoa@xxxxxxxxx>
  • Date: Fri, 25 Aug 2017 20:58:32 +0200
Dear Ashwin,


On 25/08/17 05:59, ashwin .D wrote:
Dear Antonio,
Thank you so much for the effort in doing this. I am extremely grateful given that they are so few who are actually using this and you are somebody who has always encouraged me to use nccopy for over a year now ! I am using netcdf-c-4.5-rc1 i.e. the latest netCDF version. I added this line to my .dodsrc file -

HTTP.CREDENTIALS.USERPASSWORD=winash12@xxxxxxxxx:aaaaa

and I still get the same error . Yes I totally agree about the instructions on the UCAR site. I have an open ticket with the support netcdf and I just hope they are able to figure this one out.

Where did you open the issue? do you have a link to it? The version 4.5 it's a Release Candidate and therefore there is a good chance to solve it before the final release.
I am enclosing the logs turned on with HTTP.VERBOSE. As you can see the

* Server auth using Basic with user 'k,ŷ~'
Yes, it should be the username.

Regards

Antonio

it should say winash12@xxxxxxxxx <mailto:winash12@xxxxxxxxx>. So it is still not picking the username from .netrc or the .dodsrc file.

Best wishes,
Ashwin.

On Thu, Aug 24, 2017 at 5:46 PM, Antonio S. Cofiño <cofinoa@xxxxxxxxx <mailto:cofinoa@xxxxxxxxx>> wrote:

    Dear Ashwin,

    I have tested and it's working depending on the netcdf library
    version you are using.

    With the version 4.1.3 (Ubuntu 14.04 repository package) the only
    way it'sembedding the credentials in the URI:

    $ ncdump -h
    
"https://YourUsernameUriEncoded:YourPassword@xxxxxxxxxxxx/thredds/dodsC/files/g/ds083.2/grib1/2000/2000.02/fnl_20000201_06_00.grib1
    
<http://YourPassword@xxxxxxxxxxxx/thredds/dodsC/files/g/ds083.2/grib1/2000/2000.02/fnl_20000201_06_00.grib1>"


    For netcdf library version 4.3.3.1, compiled from source, the
    embedded credentials on URI it's working.

    If you create a .dodsrc on your working directory or $HOME with
    your credentials

    $ cat .dodsrc

    HTTP.CREDENTIALS.USERPASSWORD=YourUsername:YourPassword

    $ ncdump -h
    
"https://rda.ucar.edu/thredds/dodsC/files/g/ds083.2/grib1/2000/2000.02/fnl_20000201_06_00.grib1";
    
<https://rda.ucar.edu/thredds/dodsC/files/g/ds083.2/grib1/2000/2000.02/fnl_20000201_06_00.grib1>

    and refering the .netrc file from your .dodsrc, both can be at
    your working or $HOME directory

    $ cat .netrc

    machine rda.ucar.edu <http://rda.ucar.edu> login
    YourUsernamepassword YourPassword

    $ cat .dodsrc

    HTTP.NETRC=.netrc

    $ ncdump -h
    
"https://rda.ucar.edu/thredds/dodsC/files/g/ds083.2/grib1/2000/2000.02/fnl_20000201_06_00.grib1";
    
<https://rda.ucar.edu/thredds/dodsC/files/g/ds083.2/grib1/2000/2000.02/fnl_20000201_06_00.grib1>


    I hope this helps.

    Antonio

    P.S.: The instructions on the UCAR blog about configuring
    authentication are worthless with respect to the cookie
    parameteres. This is because UCAR authentication service it's not
    using them.


    On 22/08/17 19:41, ashwin .D wrote:
    >Dear Ashwin,

    >Attached you can find a working example for the ESGF opendap endpoints.

    >You can put it on your working directory (the HOME also it's valid)

    >If the opendap endpoint it's not using SSL security you can
    ignore the HTTP.SSL.* entries.
    >If you are having troubles you can enable the HTTP.VERBOSE

    >Regards

    >Antonio
    Dear Antonio,
                  Many thanks for giving me your .dodsrc file. I added a couple 
of the lines from your .dodsrc file and tried it out and
    and I still get the same error. Have you tried downloading from the UCAR 
site recently ?
    Best regards,
    Ashwin.

    On Mon, Aug 21, 2017 at 8:12 AM, ashwin .D <winash12@xxxxxxxxx
    <mailto:winash12@xxxxxxxxx>> wrote:

        Hello,
                 Has anybody been able to use nccopy with
        redirect-based authorization and download a netCDF file ? I
        am referring to this -
        
http://ncarrda.blogspot.in/2017/07/accessing-rda-opendap-endpoints-with.html
        
<http://ncarrda.blogspot.in/2017/07/accessing-rda-opendap-endpoints-with.html>
        and I get a authorization failed error even though I have an
        appropriate .netrc file as well as dodsrc file. Using
        standard python and netCDF python I am able to read http
        request and response of metadata pages on RDA - it is only
        nccopy that is failing. Does anybody have a working example
        of nccopy with this redirect-based authorization ?

        Best,
        Ashwin.




    _______________________________________________
    NOTE: All exchanges posted to Unidata maintained email lists are
    recorded in the Unidata inquiry tracking system and made publicly
    available through the web.  Users who post to any of the lists we
    maintain are reminded to remove any personal information that they
    do not want to be made public.


    netcdfgroup mailing list
    netcdfgroup@xxxxxxxxxxxxxxxx <mailto:netcdfgroup@xxxxxxxxxxxxxxxx>
    For list information or to unsubscribe,  
visit:http://www.unidata.ucar.edu/mailing_lists/
<http://www.unidata.ucar.edu/mailing_lists/>



  • 2017 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: