0
  • Version of the library used -ADALiOS (3.0.0-pre3)
  • Once the access and refresh tokens are fetched from the server , it gets successfully parsed but while adding it to cache addorUpdateItem method is called in which error condition gets called because of cfmdKeychainDict has 0 entries.

(BOOL)addOrUpdateItem:(ADTokenCacheStoreItem*)item error:(ADAuthenticationError* __autoreleasing*)error {

ADTokenCacheStoreKey* key = [item extractKeyWithError:error];
if (!key)
{
    AD_LOG_ERROR_F(@"failed to extract key", AD_ERROR_CACHE_PERSISTENCE, @"%@", item);
    return NO;
}

__block OSStatus err = errSecSuccess;

adkeychain_dispatch_if_needed(^{
    CFMutableDictionaryRef cfmdKeychainDict = NULL;
    err = [self copyDictionary:&cfmdKeychainDict
                        userId:[item userCacheKey]
                         error:error];

    if (err == errSecItemNotFound)
    {
        cfmdKeychainDict = CFDictionaryCreateMutable(NULL, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
    }
  • Error Thrown-

    Error raised: 11. Additional Information: Domain: ADAuthenticationErrorDomain ProtocolCode: -25243 Details: ADAL Keychain "__51-[ADKeychainTokenCacheStore addOrUpdateItem:error:]_block_invoke" operation failed with error code -25243.. ErrorCode: 11.

  • Next whenever application is run a call to acquire token is sent again.
Richa Jha
  • 11
  • 3
  • Does this answer your question? http://stackoverflow.com/questions/32521104/cannot-add-a-new-item-in-the-keychain-error-code-25243-in-adal-ios/32700888#32700888 – Brandon Werner Apr 18 '16 at 19:29
  • yes this does resolve this exception but still adal is unable to cache the tokens and hence a request to acquire token is sent everytime even if the previously obtained access token is not expired. – Richa Jha May 06 '16 at 16:05

0 Answers0