AzureAD / azure-activedirectory-library-for-objc

The ADAL SDK for Objective C gives you the ability to add support for Work Accounts to your iOS and macOS applications with just a few lines of additional code. This SDK gives your application the full functionality of Microsoft Azure AD, including industry standard protocol support for OAuth2, Web API integration with user level consent, and two factor authentication support.
MIT License
178 stars 113 forks source link

Invalid protocol-property list - CFURLRequestRef #1362

Open hi-kumar opened 5 years ago

hi-kumar commented 5 years ago

Mac command line tools run into this potentially blocking issue, starting sometime between ADAL 2.5.1 & 2.7.4 releases. Calling acquireToken APIs leads to the following message piped to the stderr, that cannot be controlled by the caller. Some such tools cannot function correctly if any stderr output is seen by the caller, and such an error will definitely be confusing to the users as well.

ERROR: createEncodedCachedResponseAndRequestForXPCTransmission - Invalid protocol-property list - CFURLRequestRef. protoProps=<CFBasicHash 0x7fde2290c7c0 [0x7fffa9a228f0]>{type = mutable dict, count = 1, entries => 0 : <CFString 0x10c2634e8 [0x7fffa9a228f0]>{contents = "context"} = <ADWebAuthRequest: 0x7fde229085e0>

Based on discussion in https://github.com/AzureAD/azure-activedirectory-library-for-objc/issues/1026, this seems to be caused due to carrying the whole request context in ADURLProtocol:

[NSURLProtocol setProperty:context forKey:@"context" inRequest:request];

For GUI apps, this error gets piped to the system Console.app, which is harmless, but not ideal either. For command line tools, this can be a blocking issue depending on their usage.

@oldalton

oldalton commented 5 years ago

ADAL 4.0.0 should fix this issue, as it gets rid of custom url protocol altogether. Will take a closer look at fixing this in 2.7.8 as well.

bhumin3i commented 5 years ago

@oldalton pod install error new version

[!] CocoaPods could not find compatible versions for pod "ADAL": In Podfile: ADAL (= 4.0.0)

None of your spec sources contain a spec satisfying the dependency: ADAL (= 4.0.0).

pod 'ADAL', '2.7.7' is works

oldalton commented 5 years ago

ADAL 4.0.0 hasn't been published to CocoaPods yet, as it's a pre-release version. It will be published to CocoaPods mid next week, unless there're new issues reported with it.

For testing in the meantime, you can point CocoaPods to 4.0.0 tag in this repository: ADAL 4.0.0 release

bhumin3i commented 5 years ago

@oldalton still waiting for release!!!!

oldalton commented 5 years ago

Just pushed it out. Sorry for a delay, we were trying to verify one customer report that it's not impacting latest release. Thanks.