可以在 Java 中的链接中发送基本身份验证
是否可以在链接中发送基本身份验证凭据?我已尝试 http://username:[电子邮件] protected] 但它不起作用(在 chrome 中在 Mac 上,它不断告诉我提供 APIKey,在本例中是密码)。如果可能的话,我需要能够让用户单击链接并提供这些凭据。
有时该链接指向巨大的文件(< 1 gig)。因此,我不想下载有问题的文件,而是构建一个指向它的链接,然后让用户下载它。
它是用 Java 编写的,因为我正在制作 Java Portlet,但我可以像 html 元素一样构建链接:
<a href="https://username:[email protected]">Click here!</a>
任何建议都会有帮助, 谢谢!
Is it possible to send basic auth credentials in a link? I have tried http://username:[email protected] but it's not working (in chrome on a mac, it keeps telling me to provide APIKey, which is password in this case). I need to be able to have a user click on a link and provide these credentials, if possible.
The link is to sometimes huge files (< 1 gig). So instead of me, downloading the file in question I would like to just construct a link that points to it, and have the user download it.
It's in Java because I'm making a Java Portlet, but I can construct the link just like an html element:
<a href="https://username:[email protected]">Click here!</a>
Any advice would help,
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我记得一篇特定的 Microsoft 支持文章,其中他们明确放弃了浏览器对在 URL 中包含密码的支持,如下所示:其他浏览器很可能也是如此。
编辑:这是这篇文章。
I remember a specific Microsoft support article in which they explicitly dropped browser support for including passwords in URLs like this; it's probable that other browsers did too.
EDIT: here's the article.