Hello I have tried using wget to download class files from BlackBoard, but it keeps saying that
Reusing existing connection to uic.blackboard.com:443. HTTP request sent, awaiting response... 401
Username/Password Authentication Failed.
I may be using the command wrong. I would appreciate the help
I have tried wget and curl.
CodePudding user response:
The page you are trying to open uses javascript, which is not supported by wget - so that's the end of that option.
As for curl, what happens if you try to spoof javascript support (this may end up dumping the page source, which may not be what you are trying to achieve, but worth trying)
The following call to curl is setting the user agent so that it appears to be a javascript compatible browser, and we are also explicitly stating HTTPS protocol (even though 443 implies it, best to be clear our intentions):
curl -L -v "https://uic.blackboard.com:443" -A "Mozilla/5.0 (compatible; MSIE 7.01; Windows NT 5.0)"
CodePudding user response:
HTTP 401 error
means authorization error. You can pass authentication details through wget or curl. Please note that passing credentials directly on the terminal may lead to accidental leakage.
For basic authentication:
curl --user YOUR-USERNAME:YOUR-PASSWORD http://www.example.com
wget --user YOUR-USERNAME --password YOUR-PASSWORD http://example.com/
For oAuth-2.0 authentication:
curl -H "Authorization: OAuth <ACCESS_TOKEN>" http://www.example.com