CredStore执行查询错误 [英] CredStore Perform Query error
问题描述
我在对我的应用后端进行API调用时遇到问题,现在每个连接都提示
I am running into an issue while doing API calls to my apps backend, every connection now prompts with
CredStore - performQuery - Error copying matching creds. Error=-25300, query={
atyp = http;
class = inet;
"m_Limit" = "m_LimitAll";
ptcl = http;
"r_Attributes" = 1;
srvr = "myappsurl.com";
sync = syna;
}
我有点迷茫,因为我不确定是什么导致这个,或者CredStore甚至做了什么。
CredStore在iOS中的用途是什么?
I am a little lost as I am not sure what is causing this, or what CredStore even does. What purpose does CredStore serve in iOS?
推荐答案
尝试检索 URLCredential
来自 URLCredentialStorage
,用于未知的 URLProtectionSpace
。
例如
This error occurs when trying to retrieve an URLCredential
from URLCredentialStorage
for an unknown URLProtectionSpace
.
e.g.
let protectionSpace = URLProtectionSpace.init(host: host,
port: port,
protocol: "http",
realm: nil,
authenticationMethod: nil)
var credential: URLCredential? = URLCredentialStorage.shared.defaultCredential(for: protectionSpace)
产生
CredStore - performQuery - Error copying matching creds. Error=-25300, query={
class = inet;
"m_Limit" = "m_LimitAll";
ptcl = http;
"r_Attributes" = 1;
srvr = host;
sync = syna;
}
为保护区提供凭证:
let userCredential = URLCredential(user: user,
password: password,
persistence: .permanent)
URLCredentialStorage.shared.setDefaultCredential(userCredential, for: protectionSpace)
,下次你错误消失尝试检索凭证。
and the error goes away next time you try to retrieve the credential.
我有点迷失,因为我不确定是什么导致了这个,或者是什么
CredStore甚至。 CredStore在iOS中的用途是什么?
I am a little lost as I am not sure what is causing this, or what CredStore even does. What purpose does CredStore serve in iOS?
iOS上的凭证存储允许用户安全地存储基于证书或基于密码的凭据。设备暂时或永久到钥匙串。
Credential storage on iOS allows users to securely store certificate-based or password-based credentials on the device either temporarily or permanently to the keychain.
我怀疑您的后端服务器上有某种身份验证,并且该服务器正在请求对您的应用程序进行身份验证质询(没有凭据存在)。
I suspect that you have some sort of authentication on your backend server and that server is requesting an authentication challenge to your app (for which no credential exists).
它可能被安全地忽略,因为从 URLCredentialStorage
返回nil是一个有效的回复
It can probably be safely ignored as returning nil from the URLCredentialStorage
is a valid response
这篇关于CredStore执行查询错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!