Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When authenticating with the TDS the client receives a 403 response even when the authentication is successful. #575

Open
ndp-opendap opened this issue Feb 27, 2025 · 1 comment

Comments

@ndp-opendap
Copy link

We are still having trouble authenticating the restricted SimpleGroup dataset.:

https://thredds-test.unidata.ucar.edu/thredds/dodsC/dev/d4icomp/restricted/SimpleGroup.nc4.dds

  • With a browser (tried FireFox, Chrome, and Safari) - We receive a 403 response. After reloading the page I am able to inspect metadata / download data for both DAP2 and DAP4

  • With the cURL command line tool - We always get a 403 error after some redirects, despite having the right credentials (username/password in our ~/.netrc file). Subsequent requests, made using the cookies from the first, return the correct response and an http status of 200:

curl -n -c "~/.cookies" -b "~/.cookies" -L https://thredds-test.unidata.ucar.edu/thredds/dodsC/dev/d4icomp/restricted/SimpleGroup.nc4.dds

  • via python’s requests library: We always get 403

This is an operating system agnostic issue.

Also, when I look at the verbose cURL output it would appear that the client is redirected to an authentication endpoint here:

http://thredds-test.unidata.ucar.edu:443/thredds/restrictedAccess/opendapTesterRole

But then never redirected back to the original request URL.

@Mikejmnez
Copy link

Mikejmnez commented Mar 8, 2025

via python’s requests library: We always get 403

Python's request.session.get(url, allow_redirects=True) always resulted in 400 status code. I managed to come up with a temporary fix for this on pydap's end by manually handling the redirects and cookies. And so pydap can read DAP4 data from the TDS with authentication, but that solution is somewhat fragile.

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

No branches or pull requests

2 participants