0

My app is a cordova/ionic app. Recently one of the APIs my app pulls from had an authentication error...the token is revoked. On Android the service responsible for the API call returns an API error, the error is processed, and the app continues...but on iOS the auth error is now generating the following type of iOS error which causes the service to just spin its wheels and never return anything:

CredStore - preformQuery = Error copying matching creds Error=-25300

I have never seen this error before. This is not a standard API error, the rest of my API service call handles API errors (including auth errors), but this error isn't an API error, its an iOS error which is preventing the $http response from properly returning. I do know whats causing this or how to deal with it. Its like the auth error is triggering some kind of iOS credentials error which in turn is causing the $http(req) to just hang waiting for a response....

var req = {
  method: 'POST',
  url: 'https://api.blah.com/oauth/token',
  headers: {"Content-Type":"application/JSON", Authorization: "Basic " + blahCreds},
  data: {"grant_type":"client_credentials","scope":"public"}
}
return $http(req)
.then(function(response){

The only way I can get past this issue on iOS is to add: timeout:httpTimeout, to the $http(req) - after 30 seconds of no response that API just times out and control is returned to the app to process the timeout (and other data from other APIs returning valid data).

To further validate the response is never being returned, when I monitor my app in Safari -> Develop, I see the entry for url https://api.blah.com/oauth/token just spinning and spinning waiting for some response, but in Xcode I see the above error thrown.

rolinger
  • 2,787
  • 1
  • 31
  • 53
  • Have you followed this thread https://stackoverflow.com/questions/46099940/credstore-perform-query-error ? There are bunch of possible causes & solutions posted. – Amith Kumar Jul 03 '19 at 17:46
  • @AmithKumar I did read that one...its is one of the only threads I can find. Its similar but not quite the same as my issue and those solutions either don't work OR I am not certain how to implement them using Cordova iOS. – rolinger Jul 03 '19 at 18:02

0 Answers0