简体   繁体   English

Base64 HTTP身份验证

[英]Base64 HTTP Authenthication

How can I get the contents of a URL using base64 authentication (username:password) with the iPhone SDK 如何通过iPhone SDK使用base64身份验证(用户名:密码)获取URL的内容

Passing the username and password in the URL doesn't work because the API states that the authentication is basic web authentication, using base64 encryption of "username:password" 在URL中传递用户名和密码无效,因为API指出身份验证是基本的Web身份验证,使用的是“ username:password”的base64加密

I hope somebody can help me out with this one. 我希望有人可以帮助我解决这个问题。

Thanks in advance! 提前致谢!

Ok I've managed to figure it out. 好的,我设法弄清楚了。 You have to set the correct Authorization value in the header and this will do the trick :D 您必须在标题中设置正确的Authorization值,这将达到目的:D

You do realize that since you are sending the password in base64, you might as well just send it in plain text, right? 您确实意识到,由于您是在base64中发送密码的,因此您也可以只以纯文本格式发送密码,对吗? You should store anything you wouldn't want someone else to see in base64 due to it's very simple nature. 您应该将不希望其他人看到的任何内容存储在base64中,因为它非常简单。

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

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