开发者

Possible to Send Basic Auth in Link in Java

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开发者_Go百科@google.com">Click here!</a>

Any advice would help, Thanks!


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜