Possible to Send Basic Auth in Link in Java

拈花ヽ惹草 提交于 2020-01-17 04:07:27

问题


Is it possible to send basic auth credentials in a link? I have tried http://username:password@anapi.com 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:password@google.com">Click here!</a>

Any advice would help, Thanks!


回答1:


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.



来源:https://stackoverflow.com/questions/5679416/possible-to-send-basic-auth-in-link-in-java

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!