简体   繁体   English

Wget HTTP身份验证不正确的用户名和密码组合

[英]Wget http auth incorrect username and password combination

I'm at a total loss as to why I'm getting Authorization failed messages when I try to perform basic HTTP auth using wget on an internal webpage. 当我尝试在内部网页上使用wget执行基本的HTTP身份验证时,我迷失了为何收到授权失败消息的消息。

I've been using this wget command to pull a csv file from an internal webpage for around 4 months on a daily basis without issues. 我每天使用此wget命令从内部网页提取一个csv文件大约4个月,而且没有任何问题。

wget --user username --password "password" http://internalwebsite.domain.com/data.csv

The site is not SSL and does prompt for credentials when visiting it with a web browser. 该网站不是SSL,使用网络浏览器访问该网站时会提示输入凭据。 I've verified that the credentials I am using in the call work in a browser to download the CSV. 我已验证我在通话中使用的凭据可以在浏览器中下载CSV。

I've tried modifying the wget command by adding the following additional flags: 我尝试通过添加以下其他标志来修改wget命令:

--auth-no-challenge

I also changed the --username to --http-user and the password to --http-passwd but those options do not work either. 我也将--username更改为--http-user,将密码更改为--http-passwd,但是这些选项也不起作用。

When I attempt the connection with wget I get a 401 Unauthorized Authorization failed message. 当我尝试与wget建立连接时,我收到401未经授权授权失败消息。

The site is sharepoint,and unless something recently changed this month with IIS that disables calls from wget, I cannot figure out for the life of me what changed... 该站点是共享点,除非本月通过IIS禁用wget的调用而最近进行了某些更改,否则我将一生不知道发生了什么更改...

Any help would be appreciated. 任何帮助,将不胜感激。

I've fixed this issue by switching my command to cURL...not exactly sure why it is working when wget does not. 我已经通过将命令切换到cURL来解决了这个问题...不确定wget无法运行时为什么它可以正常工作。

Here's my code: 这是我的代码:

curl -o /path/to/file/filename.csv --anyauth --user "username:password" http://domain.com/filename.csv

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM