I m working on an iOS project with swift and Alamofire and I m getting a weird message when I m trying tot do post a request. The weird part is that for get request is working fine.
CredStore - performQuery - Error copying matching creds. Error=-25300, query={
class = inet;
"m_Limit" = "m_LimitAll";
ptcl = htps;
"r_Attributes" = 1;
sdmn = Application;
srvr = "www.***.com";
sync = syna;}
I m not sure what it means.
Alamofire.request(
path,
method: .post
).responseJSON { response in
switch response.result {
case .success(let data):
let json = JSON(data)
print(json)
case .failure(let err):
SVProgressHUD.dismiss()
print(err)
}
}
We are using Ruby on Rails for the backend and the returned json is always:
{ "error" : "" }
Also in the Rails rest controller we are using before_action :authenticate_user!
. If I remove this service from the controller is working fine but we need it. Also I've tried with the local server and with the server on a remote host but same results.
I also found this post that talks about the same error CredStore Perform Query error but we dont use username and password authentication for this app.
Another approach was to set the cookies from the login manually with Alamofire SessionManager but it did not helped.
lazy var sessionManager: SessionManager = {
let cookies = HTTPCookieStorage.shared.cookies
let configuration = URLSessionConfiguration.default
configuration.httpAdditionalHeaders = HTTPCookie.requestHeaderFields(with: cookies ?? [])
configuration.urlCredentialStorage = nil
let manager = Alamofire.SessionManager(configuration: configuration)
return manager
}()