gpt4 book ai didi

iOS:NSURLAuthenticationChallenge 是否通过网络发送加密凭据?

转载 作者:可可西里 更新时间:2023-11-01 06:09:40 24 4
gpt4 key购买 nike

我的 iOS 应用正在连接到 Sharepoint 网络服务并且 Sharepoint 使用 NTLM 身份验证。

在我这边,我已经为 NTLM 身份验证实现了以下代码:

- (void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
{
if ([challenge previousFailureCount] == 0)
{
NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
NSString *username = [userDefaults valueForKey:KEY_USERNAME];
NSString *password = [userDefaults valueForKey:KEY_PASSWORD];

NSURLCredential *newCredential;
newCredential = [NSURLCredential credentialWithUser:username password:password persistence:NSURLCredentialPersistenceNone];
[[challenge sender] useCredential:newCredential forAuthenticationChallenge:challenge];
} else {
[[challenge sender] cancelAuthenticationChallenge:challenge];
}}

所以我的问题是

  • 上面代码中发送的用户名和密码在加密形式?
  • 如果用户名和密码处于加密模式,那么如何NSURLAuthenticationChallenge 正在加密它们?

提前致谢

最佳答案

我认为凭据是否加密取决于您用来与服务器通信的协议(protocol)。例如,如果您使用的是 HTTPS,则凭据将使用 HTTPS 加密,但如果您使用的是纯 HTTP,则凭据将未加密。

关于iOS:NSURLAuthenticationChallenge 是否通过网络发送加密凭据?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19927069/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com