Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ADAL is not working for iOS 11.3 #1191

Closed
medhaj opened this issue Apr 10, 2018 · 34 comments
Closed

ADAL is not working for iOS 11.3 #1191

medhaj opened this issue Apr 10, 2018 · 34 comments
Assignees
Labels

Comments

@medhaj
Copy link

medhaj commented Apr 10, 2018

Hello,

I am using ADAL 2.6.2 installed via cocoapods. It works fine for my app until the last release of iOS 11.3. Now the SDK returns the following error: "The network connection was lost."

You can find in the following the logs from ADAL for iOS:

`018-04-10 19:07:20.815375+0200 NICE[37405:1100457] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:20] VERBOSE: ADAL API call [Version - 2.6.2] - In function: +[ADAuthenticationContext authenticationContextWithAuthority:error:], file line #176
2018-04-10 19:07:20.816330+0200 NICE[37405:1100457] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:20] VERBOSE: ADAL API call [Version - 2.6.2] - In function: +[ADAuthenticationContext authenticationContextWithAuthority:validateAuthority:error:], file line #186
2018-04-10 19:07:20.821468+0200 NICE[37405:1100457] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:20] VERBOSE: ADAL API call [Version - 2.6.2] - In function: -[ADAuthenticationContext(Internal) initWithAuthority:validateAuthority:tokenCache:error:], file line #42
2018-04-10 19:07:20.822310+0200 NICE[37405:1100457] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:20] VERBOSE: ADAL API call [Version - 2.6.2] - In function: -[ADAuthenticationContext acquireTokenWithResource:clientId:redirectUri:userId:extraQueryParameters:completionBlock:], file line #318
2018-04-10 19:07:20.823442+0200 NICE[37405:1100457] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:20 - 4FFCF554-B7CD-49C1-A523-796AC79583DB] INFO: ##### BEGIN acquireToken idtype = RequiredDisplayableId authority host: login.microsoftonline.com #####
2018-04-10 19:07:20.827349+0200 NICE[37405:1100603] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:20 - 4FFCF554-B7CD-49C1-A523-796AC79583DB] WARNING: No cached preferred_network for authority
2018-04-10 19:07:20.828999+0200 NICE[37405:1100603] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:20 - 4FFCF554-B7CD-49C1-A523-796AC79583DB] INFO: Waiting on Authority Validation Queue
2018-04-10 19:07:20.988439+0200 NICE[37405:1100618] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:20 - 4FFCF554-B7CD-49C1-A523-796AC79583DB] INFO: Caching AAD Environements
2018-04-10 19:07:20.990487+0200 NICE[37405:1100603] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:20 - 4FFCF554-B7CD-49C1-A523-796AC79583DB] INFO: Returned from Authority Validation Queue
2018-04-10 19:07:20.992510+0200 NICE[37405:1100613] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:20] VERBOSE: ADAL API call [Version - 2.6.2] - In function: +[ADTokenCacheKey keyWithAuthority:resource:clientId:error:], file line #66
2018-04-10 19:07:20.999591+0200 NICE[37405:1100613] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:20 - 4FFCF554-B7CD-49C1-A523-796AC79583DB] INFO: Failed to get a wipe data or it does not exist
2018-04-10 19:07:21.000088+0200 NICE[37405:1100613] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:21 - 4FFCF554-B7CD-49C1-A523-796AC79583DB] INFO: No items were found for query
2018-04-10 19:07:21.000817+0200 NICE[37405:1100613] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:21] VERBOSE: ADAL API call [Version - 2.6.2] - In function: +[ADTokenCacheKey keyWithAuthority:resource:clientId:error:], file line #66
2018-04-10 19:07:21.004980+0200 NICE[37405:1100613] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:21 - 4FFCF554-B7CD-49C1-A523-796AC79583DB] INFO: Failed to get a wipe data or it does not exist
2018-04-10 19:07:21.005645+0200 NICE[37405:1100613] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:21 - 4FFCF554-B7CD-49C1-A523-796AC79583DB] INFO: No items were found for query
2018-04-10 19:07:21.006439+0200 NICE[37405:1100613] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:21] VERBOSE: ADAL API call [Version - 2.6.2] - In function: +[ADTokenCacheKey keyWithAuthority:resource:clientId:error:], file line #66
2018-04-10 19:07:21.008945+0200 NICE[37405:1100613] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:21 - 4FFCF554-B7CD-49C1-A523-796AC79583DB] INFO: Failed to get a wipe data or it does not exist
2018-04-10 19:07:21.009835+0200 NICE[37405:1100613] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:21 - 4FFCF554-B7CD-49C1-A523-796AC79583DB] INFO: No items were found for query
2018-04-10 19:07:21.010310+0200 NICE[37405:1100613] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:21] VERBOSE: ADAL API call [Version - 2.6.2] - In function: +[ADTokenCacheKey keyWithAuthority:resource:clientId:error:], file line #66
2018-04-10 19:07:21.013542+0200 NICE[37405:1100613] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:21 - 4FFCF554-B7CD-49C1-A523-796AC79583DB] INFO: Failed to get a wipe data or it does not exist
2018-04-10 19:07:21.014083+0200 NICE[37405:1100613] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:21 - 4FFCF554-B7CD-49C1-A523-796AC79583DB] INFO: No items were found for query
2018-04-10 19:07:21.015327+0200 NICE[37405:1100613] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:21] VERBOSE: ADAL API call [Version - 2.6.2] - In function: +[ADTokenCacheKey keyWithAuthority:resource:clientId:error:], file line #66
2018-04-10 19:07:21.018696+0200 NICE[37405:1100613] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:21 - 4FFCF554-B7CD-49C1-A523-796AC79583DB] INFO: Failed to get a wipe data or it does not exist
2018-04-10 19:07:21.019217+0200 NICE[37405:1100613] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:21 - 4FFCF554-B7CD-49C1-A523-796AC79583DB] INFO: No items were found for query
2018-04-10 19:07:21.021371+0200 NICE[37405:1100613] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:21] VERBOSE: ADAL API call [Version - 2.6.2] - In function: +[ADTokenCacheKey keyWithAuthority:resource:clientId:error:], file line #66
2018-04-10 19:07:21.024864+0200 NICE[37405:1100613] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:21 - 4FFCF554-B7CD-49C1-A523-796AC79583DB] INFO: Failed to get a wipe data or it does not exist
2018-04-10 19:07:21.025949+0200 NICE[37405:1100613] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:21 - 4FFCF554-B7CD-49C1-A523-796AC79583DB] INFO: No items were found for query
2018-04-10 19:07:21.026528+0200 NICE[37405:1100613] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:21] VERBOSE: ADAL API call [Version - 2.6.2] - In function: +[ADTokenCacheKey keyWithAuthority:resource:clientId:error:], file line #66
2018-04-10 19:07:21.029730+0200 NICE[37405:1100613] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:21 - 4FFCF554-B7CD-49C1-A523-796AC79583DB] INFO: Failed to get a wipe data or it does not exist
2018-04-10 19:07:21.030452+0200 NICE[37405:1100613] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:21 - 4FFCF554-B7CD-49C1-A523-796AC79583DB] INFO: No items were found for query
2018-04-10 19:07:21.031040+0200 NICE[37405:1100613] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:21] VERBOSE: ADAL API call [Version - 2.6.2] - In function: +[ADTokenCacheKey keyWithAuthority:resource:clientId:error:], file line #66
2018-04-10 19:07:21.034705+0200 NICE[37405:1100613] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:21 - 4FFCF554-B7CD-49C1-A523-796AC79583DB] INFO: Failed to get a wipe data or it does not exist
2018-04-10 19:07:21.036502+0200 NICE[37405:1100613] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:21 - 4FFCF554-B7CD-49C1-A523-796AC79583DB] INFO: No items were found for query
2018-04-10 19:07:21.038037+0200 NICE[37405:1100613] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:21] VERBOSE: ADAL API call [Version - 2.6.2] - In function: +[ADTokenCacheKey keyWithAuthority:resource:clientId:error:], file line #66
2018-04-10 19:07:21.046217+0200 NICE[37405:1100613] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:21 - 4FFCF554-B7CD-49C1-A523-796AC79583DB] INFO: Failed to get a wipe data or it does not exist
2018-04-10 19:07:21.048290+0200 NICE[37405:1100613] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:21 - 4FFCF554-B7CD-49C1-A523-796AC79583DB] INFO: No items were found for query
2018-04-10 19:07:21.055095+0200 NICE[37405:1100613] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:21] VERBOSE: ADAL API call [Version - 2.6.2] - In function: +[ADTokenCacheKey keyWithAuthority:resource:clientId:error:], file line #66
2018-04-10 19:07:21.058401+0200 NICE[37405:1100613] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:21 - 4FFCF554-B7CD-49C1-A523-796AC79583DB] INFO: Failed to get a wipe data or it does not exist
2018-04-10 19:07:21.059006+0200 NICE[37405:1100613] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:21 - 4FFCF554-B7CD-49C1-A523-796AC79583DB] INFO: No items were found for query
2018-04-10 19:07:21.059720+0200 NICE[37405:1100613] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:21] VERBOSE: ADAL API call [Version - 2.6.2] - In function: +[ADTokenCacheKey keyWithAuthority:resource:clientId:error:], file line #66
2018-04-10 19:07:21.063757+0200 NICE[37405:1100613] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:21 - 4FFCF554-B7CD-49C1-A523-796AC79583DB] INFO: Failed to get a wipe data or it does not exist
2018-04-10 19:07:21.065363+0200 NICE[37405:1100613] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:21 - 4FFCF554-B7CD-49C1-A523-796AC79583DB] INFO: No items were found for query
2018-04-10 19:07:21.068281+0200 NICE[37405:1100613] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:21] VERBOSE: ADAL API call [Version - 2.6.2] - In function: +[ADTokenCacheKey keyWithAuthority:resource:clientId:error:], file line #66
2018-04-10 19:07:21.075692+0200 NICE[37405:1100613] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:21 - 4FFCF554-B7CD-49C1-A523-796AC79583DB] INFO: Failed to get a wipe data or it does not exist
2018-04-10 19:07:21.076938+0200 NICE[37405:1100613] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:21 - 4FFCF554-B7CD-49C1-A523-796AC79583DB] INFO: No items were found for query
2018-04-10 19:07:21.078490+0200 NICE[37405:1100613] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:21] VERBOSE: ADAL API call [Version - 2.6.2] - In function: +[ADTokenCacheKey keyWithAuthority:resource:clientId:error:], file line #66
2018-04-10 19:07:21.083631+0200 NICE[37405:1100613] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:21 - 4FFCF554-B7CD-49C1-A523-796AC79583DB] INFO: Failed to get a wipe data or it does not exist
2018-04-10 19:07:21.084747+0200 NICE[37405:1100613] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:21 - 4FFCF554-B7CD-49C1-A523-796AC79583DB] INFO: No items were found for query
2018-04-10 19:07:21.089221+0200 NICE[37405:1100613] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:21 - 4FFCF554-B7CD-49C1-A523-796AC79583DB] VERBOSE: Requesting authorization code
2018-04-10 19:07:22.003260+0200 NICE[37405:1100457] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:22 - 4FFCF554-B7CD-49C1-A523-796AC79583DB] VERBOSE: -webAuthShouldStartLoadRequest host: login.microsoftonline.com
2018-04-10 19:07:22.004238+0200 NICE[37405:1100457] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:22 - 4FFCF554-B7CD-49C1-A523-796AC79583DB] VERBOSE: +[ADURLProtocol canInitWithRequest:] handling host - host: login.microsoftonline.com
2018-04-10 19:07:22.005035+0200 NICE[37405:1100457] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:22 - 4FFCF554-B7CD-49C1-A523-796AC79583DB] VERBOSE: +[ADURLProtocol canInitWithRequest:] handling host - host: login.microsoftonline.com
2018-04-10 19:07:22.035732+0200 NICE[37405:1100618] ERROR: createEncodedCachedResponseAndRequestForXPCTransmission - Invalid protocol-property list - CFURLRequestRef. protoProps={
context = "<ADWebAuthRequest: 0x7b240001ea80>";
}
2018-04-10 19:07:22.036512+0200 NICE[37405:1100618] ADD: failed to create cache dictionary at path=/Users/med/Library/Developer/CoreSimulator/Devices/C409D0AA-756D-4850-A455-3D116D7A4C51/data/Containers/Data/Application/EB40C4CA-BAB1-4EBF-A757-487CDBFF6624/Library/Caches/com.hiboo.nice. key=0x7b34000105a0
2018-04-10 19:07:22.072586+0200 NICE[37405:1100618] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:22 - 4FFCF554-B7CD-49C1-A523-796AC79583DB] VERBOSE: +[ADURLProtocol canInitWithRequest:] handling host - host: login.microsoftonline.com
2018-04-10 19:07:22.073069+0200 NICE[37405:1100618] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:22 - 4FFCF554-B7CD-49C1-A523-796AC79583DB] VERBOSE: +[ADURLProtocol canonicalRequestForRequest:] - host: login.microsoftonline.com
2018-04-10 19:07:22.077773+0200 NICE[37405:1100687] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:22 - 4FFCF554-B7CD-49C1-A523-796AC79583DB] VERBOSE: -[ADURLProtocol startLoading] - host: login.microsoftonline.com
2018-04-10 19:07:22.145396+0200 NICE[37405:1100687] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:22 - 4FFCF554-B7CD-49C1-A523-796AC79583DB] VERBOSE: session:task:didReceiveChallenge:completionHandler - nsurlauthenticationmethodservertrust. Previous challenge failure count: 0
2018-04-10 19:07:22.340347+0200 NICE[37405:1100582] Task .<1> finished with error - code: -999
2018-04-10 19:07:22.341954+0200 NICE[37405:1100457] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:22 - 4FFCF554-B7CD-49C1-A523-796AC79583DB] VERBOSE: -webAuthShouldStartLoadRequest host: unknown host
2018-04-10 19:07:22.342620+0200 NICE[37405:1100457] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:22 - 4FFCF554-B7CD-49C1-A523-796AC79583DB] VERBOSE: +[ADURLProtocol canInitWithRequest:] handling host - host: unknown host
2018-04-10 19:07:22.343328+0200 NICE[37405:1100457] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:22 - 4FFCF554-B7CD-49C1-A523-796AC79583DB] VERBOSE: +[ADURLProtocol canInitWithRequest:] handling host - host: unknown host
2018-04-10 19:07:22.344487+0200 NICE[37405:1100687] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:22 - 4FFCF554-B7CD-49C1-A523-796AC79583DB] VERBOSE: -[ADURLProtocol stopLoading] - host: login.microsoftonline.com
2018-04-10 19:07:22.345045+0200 NICE[37405:1100630] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:22 - 4FFCF554-B7CD-49C1-A523-796AC79583DB] VERBOSE: +[ADURLProtocol canInitWithRequest:] handling host - host: unknown host
2018-04-10 19:07:22.345725+0200 NICE[37405:1100687] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:22 - 4FFCF554-B7CD-49C1-A523-796AC79583DB] VERBOSE: -[ADURLProtocol startLoading] - host: unknown host
2018-04-10 19:07:22.399065+0200 NICE[37405:1100687] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:22 - 4FFCF554-B7CD-49C1-A523-796AC79583DB] VERBOSE: session:task:didReceiveChallenge:completionHandler - nsurlauthenticationmethodservertrust. Previous challenge failure count: 0
2018-04-10 19:07:22.444674+0200 NICE[37405:1100687] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:22 - 4FFCF554-B7CD-49C1-A523-796AC79583DB] VERBOSE: -[ADURLProtocol stopLoading] - host: unknown host
2018-04-10 19:07:22.777144+0200 NICE[37405:1100680] WF: === Starting WebFilter logging for process NICE
2018-04-10 19:07:22.778279+0200 NICE[37405:1100680] WF: _userSettingsForUser : (null)
2018-04-10 19:07:22.779233+0200 NICE[37405:1100680] WF: _WebFilterIsActive returning: NO
2018-04-10 19:07:22.861906+0200 NICE[37405:1100457] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:22 - 4FFCF554-B7CD-49C1-A523-796AC79583DB] VERBOSE: -webAuthDidFinishLoad host: unknown host
2018-04-10 19:07:22.874427+0200 NICE[37405:1100457] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:22 - 4FFCF554-B7CD-49C1-A523-796AC79583DB] VERBOSE: -webAuthShouldStartLoadRequest host: unknown host
2018-04-10 19:07:22.875525+0200 NICE[37405:1100457] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:22 - 4FFCF554-B7CD-49C1-A523-796AC79583DB] VERBOSE: +[ADURLProtocol canInitWithRequest:] handling host - host: unknown host
2018-04-10 19:07:22.876400+0200 NICE[37405:1100457] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:22] VERBOSE: +[ADURLProtocol canInitWithRequest:] handling host - host: unknown host
2018-04-10 19:07:22.879478+0200 NICE[37405:1100457] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:22] VERBOSE: +[ADURLProtocol canInitWithRequest:] handling host - host: unknown host
2018-04-10 19:07:22.879877+0200 NICE[37405:1100457] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:22] VERBOSE: +[ADURLProtocol canonicalRequestForRequest:] - host: unknown host
2018-04-10 19:07:22.881442+0200 NICE[37405:1100687] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:22] VERBOSE: -[ADURLProtocol startLoading] - host: unknown host
2018-04-10 19:07:23.019866+0200 NICE[37405:1100687] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:23] VERBOSE: -[ADURLProtocol stopLoading] - host: unknown host
2018-04-10 19:07:23.021219+0200 NICE[37405:1100680] WF: _userSettingsForUser : (null)
2018-04-10 19:07:23.021824+0200 NICE[37405:1100680] WF: _WebFilterIsActive returning: NO
2018-04-10 19:07:23.029547+0200 NICE[37405:1100680] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:23] VERBOSE: +[ADURLProtocol canInitWithRequest:] handling host - host: unknown host
2018-04-10 19:07:23.030043+0200 NICE[37405:1100680] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:23] VERBOSE: +[ADURLProtocol canonicalRequestForRequest:] - host: unknown host
2018-04-10 19:07:23.032867+0200 NICE[37405:1100680] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:23] VERBOSE: +[ADURLProtocol canInitWithRequest:] handling host - host: unknown host
2018-04-10 19:07:23.033506+0200 NICE[37405:1100680] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:23] VERBOSE: +[ADURLProtocol canonicalRequestForRequest:] - host: unknown host
2018-04-10 19:07:23.034722+0200 NICE[37405:1100687] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:23] VERBOSE: -[ADURLProtocol startLoading] - host: unknown host
2018-04-10 19:07:23.051837+0200 NICE[37405:1100687] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:23] VERBOSE: -[ADURLProtocol stopLoading] - host: unknown host
2018-04-10 19:07:23.087656+0200 NICE[37405:1100680] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:23] VERBOSE: +[ADURLProtocol canInitWithRequest:] handling host - host: unknown host
2018-04-10 19:07:23.088402+0200 NICE[37405:1100680] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:23] VERBOSE: +[ADURLProtocol canonicalRequestForRequest:] - host: unknown host
2018-04-10 19:07:23.089837+0200 NICE[37405:1100687] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:23] VERBOSE: -[ADURLProtocol startLoading] - host: unknown host
2018-04-10 19:07:23.218788+0200 NICE[37405:1100687] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:23] VERBOSE: -[ADURLProtocol stopLoading] - host: unknown host
2018-04-10 19:07:23.223722+0200 NICE[37405:1100457] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:23 - 4FFCF554-B7CD-49C1-A523-796AC79583DB] VERBOSE: -webAuthDidFinishLoad host: unknown host
2018-04-10 19:07:24.920321+0200 NICE[37405:1100457] [LayoutConstraints] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want.
Try this:
(1) look at each constraint and try to figure out which you don't expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)
(
"<NSAutoresizingMaskLayoutConstraint:0x7b14000c3c80 _UIToolbarContentView:0x7b54000d9a80.width == UIToolbar:0x7b54000dea80.width>",
"<NSLayoutConstraint:0x7b14000a82a0 _UIButtonBarStackView:0x7b54000f2a80.leading == _UIToolbarContentView:0x7b54000d9a80.leading + 8>",
"<NSLayoutConstraint:0x7b14000a82f0 _UIButtonBarStackView:0x7b54000f2a80.trailing == _UIToolbarContentView:0x7b54000d9a80.trailing>",
"<NSLayoutConstraint:0x7b14000c12a0 _UIModernBarButton:0x7b5c0000f880.leading == _UIButtonBarButton:0x7b540010dd80.leading + 8>",
"<NSLayoutConstraint:0x7b14000c12f0 _UIButtonBarButton:0x7b540010dd80.trailing >= _UIModernBarButton:0x7b5c0000f880.trailing + 8>",
"<NSLayoutConstraint:0x7b14000c1ac0 _UIModernBarButton:0x7b5c0000fc00.leading >= _UIButtonBarButton:0x7b540010ea00.leading + 5>",
"<NSLayoutConstraint:0x7b14000c1b10 _UIButtonBarButton:0x7b540010ea00.trailing >= _UIModernBarButton:0x7b5c0000fc00.trailing + 5>",
"<NSLayoutConstraint:0x7b14000c2740 _UIModernBarButton:0x7b5c000bfd80.leading == _UIButtonBarButton:0x7b540010ec80.leading + 8>",
"<NSLayoutConstraint:0x7b14000c2790 _UIButtonBarButton:0x7b540010ec80.trailing == _UIModernBarButton:0x7b5c000bfd80.trailing + 8>",
"<NSLayoutConstraint:0x7b14000c3050 UILayoutGuide:0x7b38000c73a0.leading == _UIButtonBarButton:0x7b540010dd80.leading>",
"<NSLayoutConstraint:0x7b14000c30a0 UILayoutGuide:0x7b38000c73a0.trailing == _UIButtonBarButton:0x7b540010ec80.trailing>",
"<NSLayoutConstraint:0x7b14000c30f0 UIView:0x7b5000121a00.leading == _UIButtonBarButton:0x7b540010dd80.trailing>",
"<NSLayoutConstraint:0x7b14000c3140 _UIButtonBarButton:0x7b540010ea00.leading == UIView:0x7b5000121a00.trailing>",
"<NSLayoutConstraint:0x7b14000c3190 UIView:0x7b5000121c00.leading == _UIButtonBarButton:0x7b540010ea00.trailing>",
"<NSLayoutConstraint:0x7b14000c31e0 _UIButtonBarButton:0x7b540010ec80.leading == UIView:0x7b5000121c00.trailing>",
"<NSLayoutConstraint:0x7b14000c3d70 UIToolbar:0x7b54000dea80.width == 0>",
"<NSLayoutConstraint:0x7b14000a8020 UILayoutGuide:0x7b38000c73a0.left == _UIButtonBarStackView:0x7b54000f2a80.left>",
"<NSLayoutConstraint:0x7b14000a8110 _UIButtonBarStackView:0x7b54000f2a80.right == UILayoutGuide:0x7b38000c73a0.right>"
)

Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x7b14000c12f0 _UIButtonBarButton:0x7b540010dd80.trailing >= _UIModernBarButton:0x7b5c0000f880.trailing + 8>

Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
2018-04-10 19:07:24.923578+0200 NICE[37405:1100457] [LayoutConstraints] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want.
Try this:
(1) look at each constraint and try to figure out which you don't expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)
(
"<NSAutoresizingMaskLayoutConstraint:0x7b14000c3c80 _UIToolbarContentView:0x7b54000d9a80.width == UIToolbar:0x7b54000dea80.width>",
"<NSLayoutConstraint:0x7b14000a82a0 _UIButtonBarStackView:0x7b54000f2a80.leading == _UIToolbarContentView:0x7b54000d9a80.leading + 8>",
"<NSLayoutConstraint:0x7b14000a82f0 _UIButtonBarStackView:0x7b54000f2a80.trailing == _UIToolbarContentView:0x7b54000d9a80.trailing>",
"<NSLayoutConstraint:0x7b14000c1ac0 _UIModernBarButton:0x7b5c0000fc00.leading >= _UIButtonBarButton:0x7b540010ea00.leading + 5>",
"<NSLayoutConstraint:0x7b14000c1b10 _UIButtonBarButton:0x7b540010ea00.trailing >= _UIModernBarButton:0x7b5c0000fc00.trailing + 5>",
"<NSLayoutConstraint:0x7b14000c2740 _UIModernBarButton:0x7b5c000bfd80.leading == _UIButtonBarButton:0x7b540010ec80.leading + 8>",
"<NSLayoutConstraint:0x7b14000c2790 _UIButtonBarButton:0x7b540010ec80.trailing == _UIModernBarButton:0x7b5c000bfd80.trailing + 8>",
"<NSLayoutConstraint:0x7b14000c3050 UILayoutGuide:0x7b38000c73a0.leading == _UIButtonBarButton:0x7b540010dd80.leading>",
"<NSLayoutConstraint:0x7b14000c30a0 UILayoutGuide:0x7b38000c73a0.trailing == _UIButtonBarButton:0x7b540010ec80.trailing>",
"<NSLayoutConstraint:0x7b14000c30f0 UIView:0x7b5000121a00.leading == _UIButtonBarButton:0x7b540010dd80.trailing>",
"<NSLayoutConstraint:0x7b14000c3140 _UIButtonBarButton:0x7b540010ea00.leading == UIView:0x7b5000121a00.trailing>",
"<NSLayoutConstraint:0x7b14000c3190 UIView:0x7b5000121c00.leading == _UIButtonBarButton:0x7b540010ea00.trailing>",
"<NSLayoutConstraint:0x7b14000c31e0 _UIButtonBarButton:0x7b540010ec80.leading == UIView:0x7b5000121c00.trailing>",
"<NSLayoutConstraint:0x7b14000c3d70 UIToolbar:0x7b54000dea80.width == 0>",
"<NSLayoutConstraint:0x7b14000a8020 UILayoutGuide:0x7b38000c73a0.left == _UIButtonBarStackView:0x7b54000f2a80.left>",
"<NSLayoutConstraint:0x7b14000a8110 _UIButtonBarStackView:0x7b54000f2a80.right == UILayoutGuide:0x7b38000c73a0.right>"
)

Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x7b14000c1b10 _UIButtonBarButton:0x7b540010ea00.trailing >= _UIModernBarButton:0x7b5c0000fc00.trailing + 5>

Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
2018-04-10 19:07:24.925972+0200 NICE[37405:1100457] [LayoutConstraints] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want.
Try this:
(1) look at each constraint and try to figure out which you don't expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)
(
"<NSAutoresizingMaskLayoutConstraint:0x7b14000c3c80 _UIToolbarContentView:0x7b54000d9a80.width == UIToolbar:0x7b54000dea80.width>",
"<NSLayoutConstraint:0x7b14000a82a0 _UIButtonBarStackView:0x7b54000f2a80.leading == _UIToolbarContentView:0x7b54000d9a80.leading + 8>",
"<NSLayoutConstraint:0x7b14000a82f0 _UIButtonBarStackView:0x7b54000f2a80.trailing == _UIToolbarContentView:0x7b54000d9a80.trailing>",
"<NSLayoutConstraint:0x7b14000c2740 _UIModernBarButton:0x7b5c000bfd80.leading == _UIButtonBarButton:0x7b540010ec80.leading + 8>",
"<NSLayoutConstraint:0x7b14000c2790 _UIButtonBarButton:0x7b540010ec80.trailing == _UIModernBarButton:0x7b5c000bfd80.trailing + 8>",
"<NSLayoutConstraint:0x7b14000c3050 UILayoutGuide:0x7b38000c73a0.leading == _UIButtonBarButton:0x7b540010dd80.leading>",
"<NSLayoutConstraint:0x7b14000c30a0 UILayoutGuide:0x7b38000c73a0.trailing == _UIButtonBarButton:0x7b540010ec80.trailing>",
"<NSLayoutConstraint:0x7b14000c30f0 UIView:0x7b5000121a00.leading == _UIButtonBarButton:0x7b540010dd80.trailing>",
"<NSLayoutConstraint:0x7b14000c3140 _UIButtonBarButton:0x7b540010ea00.leading == UIView:0x7b5000121a00.trailing>",
"<NSLayoutConstraint:0x7b14000c3190 UIView:0x7b5000121c00.leading == _UIButtonBarButton:0x7b540010ea00.trailing>",
"<NSLayoutConstraint:0x7b14000c31e0 _UIButtonBarButton:0x7b540010ec80.leading == UIView:0x7b5000121c00.trailing>",
"<NSLayoutConstraint:0x7b14000c3d70 UIToolbar:0x7b54000dea80.width == 0>",
"<NSLayoutConstraint:0x7b14000a8020 UILayoutGuide:0x7b38000c73a0.left == _UIButtonBarStackView:0x7b54000f2a80.left>",
"<NSLayoutConstraint:0x7b14000a8110 _UIButtonBarStackView:0x7b54000f2a80.right == UILayoutGuide:0x7b38000c73a0.right>"
)

Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x7b14000c2790 _UIButtonBarButton:0x7b540010ec80.trailing == _UIModernBarButton:0x7b5c000bfd80.trailing + 8>

Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
2018-04-10 19:07:24.928236+0200 NICE[37405:1100457] [LayoutConstraints] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want.
Try this:
(1) look at each constraint and try to figure out which you don't expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)
(
"<NSAutoresizingMaskLayoutConstraint:0x7b14000c3c80 _UIToolbarContentView:0x7b54000d9a80.width == UIToolbar:0x7b54000dea80.width>",
"<NSLayoutConstraint:0x7b14000a82a0 _UIButtonBarStackView:0x7b54000f2a80.leading == _UIToolbarContentView:0x7b54000d9a80.leading + 8>",
"<NSLayoutConstraint:0x7b14000a82f0 _UIButtonBarStackView:0x7b54000f2a80.trailing == _UIToolbarContentView:0x7b54000d9a80.trailing>",
"<NSLayoutConstraint:0x7b14000c3050 UILayoutGuide:0x7b38000c73a0.leading == _UIButtonBarButton:0x7b540010dd80.leading>",
"<NSLayoutConstraint:0x7b14000c30a0 UILayoutGuide:0x7b38000c73a0.trailing == _UIButtonBarButton:0x7b540010ec80.trailing>",
"<NSLayoutConstraint:0x7b14000c30f0 UIView:0x7b5000121a00.leading == _UIButtonBarButton:0x7b540010dd80.trailing>",
"<NSLayoutConstraint:0x7b14000c3140 _UIButtonBarButton:0x7b540010ea00.leading == UIView:0x7b5000121a00.trailing>",
"<NSLayoutConstraint:0x7b14000c3190 UIView:0x7b5000121c00.leading == _UIButtonBarButton:0x7b540010ea00.trailing>",
"<NSLayoutConstraint:0x7b14000c31e0 _UIButtonBarButton:0x7b540010ec80.leading == UIView:0x7b5000121c00.trailing>",
"<NSLayoutConstraint:0x7b14000c3d70 UIToolbar:0x7b54000dea80.width == 0>",
"<NSLayoutConstraint:0x7b14000a8020 UILayoutGuide:0x7b38000c73a0.left == _UIButtonBarStackView:0x7b54000f2a80.left>",
"<NSLayoutConstraint:0x7b14000a8110 _UIButtonBarStackView:0x7b54000f2a80.right == UILayoutGuide:0x7b38000c73a0.right>"
)

Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x7b14000c31e0 _UIButtonBarButton:0x7b540010ec80.leading == UIView:0x7b5000121c00.trailing>

Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
2018-04-10 19:07:24.929930+0200 NICE[37405:1100457] [LayoutConstraints] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want.
Try this:
(1) look at each constraint and try to figure out which you don't expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)
(
"<NSAutoresizingMaskLayoutConstraint:0x7b14000c3c80 _UIToolbarContentView:0x7b54000d9a80.width == UIToolbar:0x7b54000dea80.width>",
"<NSLayoutConstraint:0x7b14000a82a0 _UIButtonBarStackView:0x7b54000f2a80.leading == _UIToolbarContentView:0x7b54000d9a80.leading + 8>",
"<NSLayoutConstraint:0x7b14000a82f0 _UIButtonBarStackView:0x7b54000f2a80.trailing == _UIToolbarContentView:0x7b54000d9a80.trailing>",
"<NSLayoutConstraint:0x7b14000c3d70 UIToolbar:0x7b54000dea80.width == 0>"
)

Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x7b14000a82f0 _UIButtonBarStackView:0x7b54000f2a80.trailing == _UIToolbarContentView:0x7b54000d9a80.trailing>

Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
2018-04-10 19:07:24.984926+0200 NICE[37405:1100457] [Snapshotting] Snapshotting a view (0x7b5000078c00, UIInputSetHostView) that has not been rendered at least once requires afterScreenUpdates:YES.
2018-04-10 19:07:32.140729+0200 NICE[37405:1100457] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:32 - 4FFCF554-B7CD-49C1-A523-796AC79583DB] VERBOSE: -webAuthShouldStartLoadRequest host: unknown host
2018-04-10 19:07:32.147095+0200 NICE[37405:1100457] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:32 - 4FFCF554-B7CD-49C1-A523-796AC79583DB] VERBOSE: +[ADURLProtocol canInitWithRequest:] handling host - host: unknown host
2018-04-10 19:07:32.148132+0200 NICE[37405:1100457] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:32] VERBOSE: +[ADURLProtocol canInitWithRequest:] handling host - host: unknown host
2018-04-10 19:07:32.170958+0200 NICE[37405:1100457] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:32] VERBOSE: +[ADURLProtocol canInitWithRequest:] handling host - host: unknown host
2018-04-10 19:07:32.171367+0200 NICE[37405:1100457] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:32] VERBOSE: +[ADURLProtocol canonicalRequestForRequest:] - host: unknown host
2018-04-10 19:07:32.172327+0200 NICE[37405:1100687] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:32] VERBOSE: -[ADURLProtocol startLoading] - host: unknown host
2018-04-10 19:07:32.282985+0200 NICE[37405:1100603] Task <69459BE9-52A9-4883-986A-22C0EEA32A70>.<6> finished with error - code: -999
2018-04-10 19:07:32.284828+0200 NICE[37405:1100457] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:32 - 4FFCF554-B7CD-49C1-A523-796AC79583DB] VERBOSE: -webAuthShouldStartLoadRequest host: unknown host
2018-04-10 19:07:32.286150+0200 NICE[37405:1100457] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:32] VERBOSE: +[ADURLProtocol canInitWithRequest:] handling host - host: unknown host
2018-04-10 19:07:32.286658+0200 NICE[37405:1100457] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:32] VERBOSE: +[ADURLProtocol canInitWithRequest:] handling host - host: unknown host
2018-04-10 19:07:32.287734+0200 NICE[37405:1100687] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:32] VERBOSE: -[ADURLProtocol stopLoading] - host: unknown host
2018-04-10 19:07:32.289246+0200 NICE[37405:1100613] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:32] VERBOSE: +[ADURLProtocol canInitWithRequest:] handling host - host: unknown host
2018-04-10 19:07:32.290172+0200 NICE[37405:1100687] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:32] VERBOSE: -[ADURLProtocol startLoading] - host: unknown host
2018-04-10 19:07:32.314930+0200 NICE[37405:1100613] TIC Read Status [9:0x7b30000a0b00]: 1:54
2018-04-10 19:07:32.444425+0200 NICE[37405:1100613] TIC Read Status [10:0x7b300019d580]: 1:54
2018-04-10 19:07:32.519821+0200 NICE[37405:1100885] TIC Read Status [11:0x7b30001b0b40]: 1:54
2018-04-10 19:07:33.117761+0200 NICE[37405:1100613] TIC Read Status [12:0x7b30001afac0]: 1:54
2018-04-10 19:07:33.120521+0200 NICE[37405:1100613] Task .<7> HTTP load failed (error code: -1005 [4:-4])
2018-04-10 19:07:33.121252+0200 NICE[37405:1100603] Task .<7> finished with error - code: -1005
2018-04-10 19:07:33.122030+0200 NICE[37405:1100591] NSURLConnection finished with error - code -1005
2018-04-10 19:07:33.123830+0200 NICE[37405:1100457] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:33 - 4FFCF554-B7CD-49C1-A523-796AC79583DB] ERROR: -webAuthDidFailWithError error code -1005
2018-04-10 19:07:33.124978+0200 NICE[37405:1100687] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:33] VERBOSE: -[ADURLProtocol stopLoading] - host: unknown host
2018-04-10 19:07:33.125535+0200 NICE[37405:1100457] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:33 - 4FFCF554-B7CD-49C1-A523-796AC79583DB] ERROR: Error raised: (Domain: "NSURLErrorDomain" Code: -1005 ProtocolCode: "(null)"
2018-04-10 19:07:33.661391+0200 NICE[37405:1100457] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:33 - 4FFCF554-B7CD-49C1-A523-796AC79583DB] INFO: ##### END failed { domain: NSURLErrorDomain code: -1005 protocolCode: (null) idtype = RequiredDisplayableId authority host: login.microsoftonline.com #####
2018-04-10 19:07:33.666603+0200 NICE[37405:1100457] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:33] WARNING: Removing all items for client
2018-04-10 19:07:33.668648+0200 NICE[37405:1100457] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:33] INFO: Failed to get a wipe data or it does not exist
2018-04-10 19:07:33.669012+0200 NICE[37405:1100457] ADAL 2.6.2 iOS Sim 11.3 [2018-04-10 17:07:33] INFO: No items were found for query
`

Please let me know when this bug will be fixed.

Best regards

@oldalton
Copy link
Member

oldalton commented Apr 11, 2018

Hi. Thanks for your report. Can you please provide us some more information about the account type you're using? Are you doing 2-factor authentication, when the error happens by any chance?

We're aware of the issue and we have submitted a bug report to Apple on April 3rd. We haven't yet heard back from them, but we're closely tracking this issue. Any additional information you can provide about the nature of the issue will help us in the investigation.

@medhaj
Copy link
Author

medhaj commented Apr 11, 2018

Hello @oldalton,

Thank you for your prompt reply. I am using ADAL for OAuth by calling the the acquireToken method of the SDK. Here a sample code from my app.

`
ADLogger.setLevel(ADAL_LOG_LEVEL_VERBOSE)

    let authContext = AuthEndpoint.authContext()
    let clientId = ProjectConfig.main.adalClientID
    
    authContext?.acquireToken(withResource: ProjectConfig.main.adalResourceID,
                              clientId: clientId,
                              redirectUri: ProjectConfig.main.adalRedirectURL!,
                              userId: "",
                              extraQueryParameters: "domain_hint=my_domain_hint",
                              completionBlock: { (result: ADAuthenticationResult?) in
                                
                                if result?.status != AD_SUCCEEDED {
                                    // handle error
                                    Logger.error("Login: \(String(describing: result?.error.errorDetails))")
                                }
                                else {
                                    //save access token
                                    AuthEndpoint.authorization = "Bearer \(result?.tokenCacheItem.accessToken ?? "")"
                                }
    })

`

Here the authContext function:

`static func authContext() -> ADAuthenticationContext? {

    var error: ADAuthenticationError? = nil
    return ADAuthenticationContext(authority: "https://login.microsoftonline.com/common", error: &error)

}`

I am using domain_hint to force ADAL to display my company gateway instead of displaying the Microsoft login page and then redirect to my company gateway.

I have a button in my app that will trigger the acquireToken function that will display an EMBEDDED webview with the authentication gateway of my company. The user is asked to provide AD username and password. Once confirmed, ADAL will dismiss the webview and returns the access token that I save to use with my api.

This code works for older ios versions, but with iOS 11.3, all the process works until the user confirms his credentials, then ADAL will dismiss the webview but return an error "The network connection was lost." I suspect, the network issue is due to Apple TLS introduced in iOS9. I guess with iOS 11.3, they reinforced the security layer by blocking some requests done by ADAL with may lead to a network connection interruption issue. Please let me know if you have any way that can fix this bug since it is quite blocking for us. We already have few users on the recent iOS version and blocked and the number is growing.

Best regards

@elsewhat
Copy link

We are experiencing the same issue for users with two-factor authentication with Microsoft Authenticator on the same device. It is the switch to background of the app initiating the adal authentication that triggers the error. We have implemented a temporary workaround by having a dummy background task which is alive for 2 minutes, but would very much like a fix for the root cause.

PS from our apps we are using the react-native-ms-adal library https://github.com/samcolby/react-native-ms-adal , but it's a wrapper around this library

@medhaj
Copy link
Author

medhaj commented Apr 12, 2018

Thanks @elsewhat for your comment. I can't see why a background process is needed to keep the app alive in my case since I do not leave the app at all. The authentication process is embedded in the app. Would you please detail more your workaround ?

Best regards

@elsewhat
Copy link

elsewhat commented Apr 12, 2018

Might be a slightly different case in iOS 11.3 than yours @medhaj

Our apps lose the connection when the user swaps to the Microsoft authenticator app in order to verify second factor of authentication. The initiating app then enter background.
This is the workaround we've made in AppDelegate.m

+- (void)applicationDidEnterBackground:(UIApplication *)application
+{
+  __block UIBackgroundTaskIdentifier bgTask;
+  bgTask = [application beginBackgroundTaskWithName:@"KeepAlive" expirationHandler:^{
+    NSLog(@"Background task expired");
+
+    // Clean up any unfinished task business by marking where you
+    // stopped or ending the task outright.
+
+    [application endBackgroundTask:bgTask];
+    bgTask = UIBackgroundTaskInvalid;
+  }];
+
+  // Start the long-running task and return immediately.
+  dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+    NSLog(@"Running background task");
+    [NSThread sleepForTimeInterval:120];
+    NSLog(@"Ended background task");
+
+    [application endBackgroundTask:bgTask];
+    bgTask = UIBackgroundTaskInvalid;
+  });
+}
+

@oldalton
Copy link
Member

oldalton commented Apr 12, 2018

Hi, ourselves we could only reproduce the issue when backgrounding the application so far. But for certain accounts it's a 100% reproduction when backgrounding the application. For us it seemed that it depends a lot on how the login webpage sends requests (synchronous/asynchronous). So, I'm not surprised that a background task "hack" can relief some of the symptoms.

However, we are also able to reproduce this with a dummy UIWebView or WKWebView project (see attached). The symptoms look a bit different there because of how ADAL uses NSURLProtocol, but it's also the same repro there - in case of ADAL, the authentication fails, because we receive NSURLSession -1005 error and fail the authentication. In case of UIWebView/WKWebView, it just hangs and you can see from the logs that they also get -1005, the webpage never redirects, so the end result is the same and user is unable to login. The reproduction without ADAL and reproducibility only in iOS 11.3 makes us believe that it's an Apple issue or a change they introduced recently. We've submitted a bug report and have reached out to Apple to escalate the issue and get additional guidance.

Meanwhile, please try to login with your user in the attached project (TestWebView113.zip) and check if you see the webview "hanging" and something like this in the log:

2018-04-12 09:15:19.668292-0700 TestWebView113[890:390175] Task <547236A5-E9CE-4DE0-BC5F-9DD1F0805962>.<0> HTTP load failed (error code: -1005 [4:-4])

That way we can make sure it's the same issue. Thanks!

@pvroosendaal
Copy link

Experiencing the same thing here. Workaround fixed it for now, but would love to see a solid solution for this.

@jimespen
Copy link

I'm experiencing the same in my Xamarin.iOS app using ADAL.NET. Does anyone know what the C# equivalent to this workaround would be? The type UIBackgroundTaskIdentifier does not exist in Xamarin.iOS.

@pvroosendaal
Copy link

The idea is that you keep your app “alive” when it moves to the background. Is there any mechanism for that in c#?

@pvroosendaal
Copy link

Or maybe reference to a native piece of code? Is that a possibility?

@medhaj
Copy link
Author

medhaj commented Apr 13, 2018

This is the swift version of the workaround. Hope it helps

`

    var bgTask: UIBackgroundTaskIdentifier = UIBackgroundTaskInvalid

    bgTask = application.beginBackgroundTask(withName: "KeepAlive", expirationHandler: {

        application.endBackgroundTask(bgTask)

        bgTask = UIBackgroundTaskInvalid

    })

    DispatchQueue.global().async {

        sleep(120)

        application.endBackgroundTask(bgTask)

        bgTask = UIBackgroundTaskInvalid

    }

`

For my case, it does not help since I am using the Embedded webview in the app. So the app does not enter the background at all.

@jimespen
Copy link

jimespen commented Apr 13, 2018

@pvroosendaal Following the docs (https://docs.microsoft.com/en-gb/xamarin/ios/app-fundamentals/backgrounding/ios-backgrounding-techniques/ios-backgrounding-with-tasks#performing-tasks-during-didenterbackground), I got it to work like so in AppDelegate.cs:

public override void DidEnterBackground(UIApplication application)
{
    base.DidEnterBackground(application);

    nint taskID = UIApplication.SharedApplication.BeginBackgroundTask(() => { });
    new Task(() =>
    {
            Thread.Sleep(20000);
        UIApplication.SharedApplication.EndBackgroundTask(taskID);
    }).Start();
}

@medhaj
Copy link
Author

medhaj commented Apr 16, 2018

Hello,

@oldalton, I tested your dummy UIWebView project and the webview is returning the issue your described when using my account.
Here the trace for more details:

2018-04-16 10:53:08.217485+0200 TestWebView113[2220:919333] CFNetwork Diagnostics [3:10952] 10:53:08.216 {
HTTPCookieStorage::setCookie: <CFHTTPCookieStorage 0x101605da0 [0x101605db0]>
Cookie URL: login.microsoftonline.com
Cookie_0_0x1017c38c0: dict [9] {
Domain: login.microsoftonline.com
Session: YES
Secure: YES
Created: 2018-04-16 08:53:08 +0000
Partition: NULL
Path: /
Name: stsservicecookie
HTTPOnly: YES
Value: ests
}
} [3:10952]
2018-04-16 10:53:08.219144+0200 TestWebView113[2220:919333] CFNetwork Diagnostics [3:10953] 10:53:08.218 {
destroyReadStream: request POST https://login.microsoftonline.com/common/GetCredentialType HTTP/1.1
Request: <CFURLRequest 0x112c0b2a0 [0x1b3dbe538]> {url = https://login.microsoftonline.com/common/GetCredentialType, cs = 0x0}
sent: <CFNumber 0xb00000000000a863 [0x1b3dbe538]>{value = +2694, type = kCFNumberSInt64Type}
received: <CFNumber 0xb000000000008953 [0x1b3dbe538]>{value = +2197, type = kCFNumberSInt64Type}
cell sent: <CFNumber 0xb000000000000003 [0x1b3dbe538]>{value = +0, type = kCFNumberSInt64Type}
cell received: <CFNumber 0xb000000000000003 [0x1b3dbe538]>{value = +0, type = kCFNumberSInt64Type}
} [3:10953]
2018-04-16 10:53:08.219908+0200 TestWebView113[2220:919524] CFNetwork Diagnostics [3:10954] 10:53:08.219 {
touchConnection: (null)
Loader: <CFMutableURLRequest 0x10f522190 [0x1b3dbe538]> {url = https://login.microsoftonline.com/common/GetCredentialType, cs = 0x0}
Timeout Interval: 2147483647.000 seconds
} [3:10954]
2018-04-16 10:53:08.221547+0200 TestWebView113[2220:919524] CFNetwork Diagnostics [3:10955] 10:53:08.221 {
Load Data: (null)
Loader: <CFMutableURLRequest 0x10f522190 [0x1b3dbe538]> {url = https://login.microsoftonline.com/common/GetCredentialType, cs = 0x0}
Length: 1553
Original Length: 1553
} [3:10955]
2018-04-16 10:53:08.221808+0200 TestWebView113[2220:919524] CFNetwork Diagnostics [3:10956] 10:53:08.221 {
touchConnection: (null)
Loader: <CFMutableURLRequest 0x10f522190 [0x1b3dbe538]> {url = https://login.microsoftonline.com/common/GetCredentialType, cs = 0x0}
Timeout Interval: 2147483647.000 seconds
} [3:10956]
2018-04-16 10:53:08.222078+0200 TestWebView113[2220:919333] CFNetwork Diagnostics [3:10957] 10:53:08.221 {
Response Complete: (null)
Request: <CFURLRequest 0x112c0b2a0 [0x1b3dbe538]> {url = https://login.microsoftonline.com/common/GetCredentialType, cs = 0x0}
} [3:10957]
2018-04-16 10:53:08.223901+0200 TestWebView113[2220:919333] CFNetwork Diagnostics [3:10958] 10:53:08.223 {
Did Finish: (null)
Loader: <CFMutableURLRequest 0x10f522190 [0x1b3dbe538]> {url = https://login.microsoftonline.com/common/GetCredentialType, cs = 0x0}
init to origin load: 0.00696194s
total time: 1.32238s
total bytes: 1553
} [3:10958]
2018-04-16 10:53:08.224060+0200 TestWebView113[2220:919333] CFNetwork Diagnostics [3:10959] 10:53:08.223 {
touchConnection: (null)
Loader: <CFMutableURLRequest 0x10f522190 [0x1b3dbe538]> {url = https://login.microsoftonline.com/common/GetCredentialType, cs = 0x0}
Timeout Interval: 2147483647.000 seconds
} [3:10959]
2018-04-16 10:53:08.226156+0200 TestWebView113[2220:919522] CFNetwork Diagnostics [3:10960] 10:53:08.225 {
~HTTPProtocol: nullptr request
Request: null
sent: 2694
received: 2197
cell sent: 0
cell received: 0
} [3:10960]
2018-04-16 10:53:10.223419+0200 TestWebView113[2220:919313] CFNetwork Diagnostics [3:10961] 10:53:10.222 {
DiskCookieStorage Sync Request: (null)
Forced: no
isDirty: yes
isWriting: no
File: <CFURL 0x10d838b70 [0x1b3dbe538]>{string = file:///private/var/mobile/Containers/Data/Application/54B39B0A-825F-4084-9CA3-D1C2632DBE0D/Library/Cookies/Cookies.binarycookies, encoding = 134217984, base = (null)}
Journal: yes
Mutations: 16
} [3:10961]
2018-04-16 10:53:10.224289+0200 TestWebView113[2220:919313] CFNetwork Diagnostics [3:10962] 10:53:10.223 {
DiskCookieStorage Checking: Binary{ Disk Cookies: { /private/var/mobile/Containers/Data/Application/54B39B0A-825F-4084-9CA3-D1C2632DBE0D/Library/Cookies/Cookies.binarycookies, <10 cookies in 4 domains> dirty not writing } }
File: <CFURL 0x10d838b70 [0x1b3dbe538]>{string = file:///private/var/mobile/Containers/Data/Application/54B39B0A-825F-4084-9CA3-D1C2632DBE0D/Library/Cookies/Cookies.binarycookies, encoding = 134217984, base = (null)}
Disk Mod: 2018-04-16 08:52:52 +0000
Last Sync: 2018-04-16 08:52:52 +0000
Persistent Cookies: <3 cookies in 2 domains>
Session Cookies: <7 cookies in 3 domains>
Journal: not required
} [3:10962]
2018-04-16 10:53:10.234967+0200 TestWebView113[2220:919212] CFNetwork Diagnostics [3:10963] 10:53:10.234 {
DiskCookieStorage Updated: Binary{ Disk Cookies: { /private/var/mobile/Containers/Data/Application/54B39B0A-825F-4084-9CA3-D1C2632DBE0D/Library/Cookies/Cookies.binarycookies, <10 cookies in 4 domains> dirty writing } }
Persistent Cookies: <3 cookies in 2 domains>
Session Cookies: <7 cookies in 3 domains>
Time from first dirty: 2.02072
Time from last dirty: 2.01678
Total time to write: 0.0100809
} [3:10963]
2018-04-16 10:53:10.436078+0200 TestWebView113[2220:919524] CFNetwork Diagnostics [3:10964] 10:53:10.435 {
LoaderWhatToDo: (null)
Request: <CFURL 0x10f56e9f0 [0x1b3dbe538]>{string = https://idp.clasp-infra.com/adfs/ls/?client-request-id=25e519d0-0862-49b4-9f8c-56c4a41b02d4&wa=wsignin1.0&wtrealm=urn%3afederation%3aMicrosoftOnline&wctx=LoginOptions%3D3%26estsredirect%3d2%26estsrequest%3drQIIAXWSvY_SYADGKdwR7jTnxZh4xoVBF7Xw9uNtKcnF4-PAnlAo0APehZTSQgtvXyzFSkdnh5tvMTEmJudgYhy8Gy9ON12i040mJsbJODkKf4DLM_2GJ8_veRBjUkz2Hs_xUBf7Ei3pAkfzEgNonWcFmoOcwLGAGUDAeTc3ty_v_LjfT3ySX786_PL2bvTbCXV75PvTWTadDoIgRSzLNsyUQXD6M0VdUtRPijqOrlseXWqcRGcCJ0CJFyAUAMtCwHBiCjndRa2lhQpWfVTUoLIAAOEDXGnLsBtqPirLELUPxkpRBoojh0oZTbot-QVyxr7iGGF1yXedYVBpDfnqklewHFRZFVbZfaZWHIZX0Ru13Nwfsasgnh2af6IbFvFwb0pm_nHsHVWbmq48KBDXNQ0_tcJM17cN3beJW_fI1PR825ztjlGOsXDjkHmqZ5qd-jMmL45skqk02rjX0sr1UrPIYUTCoSUUNNjXHW_uCZ22rjRAhy4QYOeaT3qeqJaNccl1wCAzZJvz52qGwagaGOJgPzBzza7IaZqwX0S82-ZAvWQ0jKHdC1UJsB9j8eWsmLgXsa1lKdceJKceseyJ-T22g0e6M9HJfM-Y6LMpbbuWp68sXK5Rv9aug2g2kbi2HduJJCN_16g360uR77fOPzw-Pds7HX09r798FLlYT-ct6-G8
2018-04-16 10:53:10.438781+0200 TestWebView113[2220:919212] CFNetwork Diagnostics [3:10965] 10:53:10.437 {
AddCookies Continue: request GET https://idp.clasp-infra.com/adfs/ls/?client-request-id=25e519d0-0862-49b4-9f8c-56c4a41b02d4&wa=wsignin1.0&wtrealm=urn%3afederation%3aMicrosoftOnline&wctx=LoginOptions%3D3%26estsredirect%3d2%26estsrequest%3drQIIAXWSvY_SYADGKdwR7jTnxZh4xoVBF7Xw9uNtKcnF4-PAnlAo0APehZTSQgtvXyzFSkdnh5tvMTEmJudgYhy8Gy9ON12i040mJsbJODkKf4DLM_2GJ8_veRBjUkz2Hs_xUBf7Ei3pAkfzEgNonWcFmoOcwLGAGUDAeTc3ty_v_LjfT3ySX786_PL2bvTbCXV75PvTWTadDoIgRSzLNsyUQXD6M0VdUtRPijqOrlseXWqcRGcCJ0CJFyAUAMtCwHBiCjndRa2lhQpWfVTUoLIAAOEDXGnLsBtqPirLELUPxkpRBoojh0oZTbot-QVyxr7iGGF1yXedYVBpDfnqklewHFRZFVbZfaZWHIZX0Ru13Nwfsasgnh2af6IbFvFwb0pm_nHsHVWbmq48KBDXNQ0_tcJM17cN3beJW_fI1PR825ztjlGOsXDjkHmqZ5qd-jMmL45skqk02rjX0sr1UrPIYUTCoSUUNNjXHW_uCZ22rjRAhy4QYOeaT3qeqJaNccl1wCAzZJvz52qGwagaGOJgPzBzza7IaZqwX0S82-ZAvWQ0jKHdC1UJsB9j8eWsmLgXsa1lKdceJKceseyJ-T22g0e6M9HJfM-Y6LMpbbuWp68sXK5Rv9aug2g2kbi2HduJJCN_16g360uR77fOPzw-Pds7HX09r798FLlYT-ct6-G84U2QRGy-k3cXKs4v3MpCFx1pAlvjcl6r8OaBOcL8LptljuLUU
2018-04-16 10:53:10.441786+0200 TestWebView113[2220:919212] CFNetwork Diagnostics [3:10966] 10:53:10.441 {
HTTPCookieStorage::copyCookiesForURL: <CFHTTPCookieStorage 0x101605da0 [0x101605db0]>
Request URL: https://idp.clasp-infra.com/adfs/ls/?client-request-id=25e519d0-0862-49b4-9f8c-56c4a41b02d4&wa=wsignin1.0&wtrealm=urn%3afederation%3aMicrosoftOnline&wctx=LoginOptions%3D3%26estsredirect%3d2%26estsrequest%3drQIIAXWSvY_SYADGKdwR7jTnxZh4xoVBF7Xw9uNtKcnF4-PAnlAo0APehZTSQgtvXyzFSkdnh5tvMTEmJudgYhy8Gy9ON12i040mJsbJODkKf4DLM_2GJ8_veRBjUkz2Hs_xUBf7Ei3pAkfzEgNonWcFmoOcwLGAGUDAeTc3ty_v_LjfT3ySX786_PL2bvTbCXV75PvTWTadDoIgRSzLNsyUQXD6M0VdUtRPijqOrlseXWqcRGcCJ0CJFyAUAMtCwHBiCjndRa2lhQpWfVTUoLIAAOEDXGnLsBtqPirLELUPxkpRBoojh0oZTbot-QVyxr7iGGF1yXedYVBpDfnqklewHFRZFVbZfaZWHIZX0Ru13Nwfsasgnh2af6IbFvFwb0pm_nHsHVWbmq48KBDXNQ0_tcJM17cN3beJW_fI1PR825ztjlGOsXDjkHmqZ5qd-jMmL45skqk02rjX0sr1UrPIYUTCoSUUNNjXHW_uCZ22rjRAhy4QYOeaT3qeqJaNccl1wCAzZJvz52qGwagaGOJgPzBzza7IaZqwX0S82-ZAvWQ0jKHdC1UJsB9j8eWsmLgXsa1lKdceJKceseyJ-T22g0e6M9HJfM-Y6LMpbbuWp68sXK5Rv9aug2g2kbi2HduJJC
2018-04-16 10:53:10.444820+0200 TestWebView113[2220:919212] CFNetwork Diagnostics [3:10967] 10:53:10.443 {
Protocol Enqueue: request GET https://idp.clasp-infra.com/adfs/ls/?client-request-id=25e519d0-0862-49b4-9f8c-56c4a41b02d4&wa=wsignin1.0&wtrealm=urn%3afederation%3aMicrosoftOnline&wctx=LoginOptions%3D3%26estsredirect%3d2%26estsrequest%3drQIIAXWSvY_SYADGKdwR7jTnxZh4xoVBF7Xw9uNtKcnF4-PAnlAo0APehZTSQgtvXyzFSkdnh5tvMTEmJudgYhy8Gy9ON12i040mJsbJODkKf4DLM_2GJ8_veRBjUkz2Hs_xUBf7Ei3pAkfzEgNonWcFmoOcwLGAGUDAeTc3ty_v_LjfT3ySX786_PL2bvTbCXV75PvTWTadDoIgRSzLNsyUQXD6M0VdUtRPijqOrlseXWqcRGcCJ0CJFyAUAMtCwHBiCjndRa2lhQpWfVTUoLIAAOEDXGnLsBtqPirLELUPxkpRBoojh0oZTbot-QVyxr7iGGF1yXedYVBpDfnqklewHFRZFVbZfaZWHIZX0Ru13Nwfsasgnh2af6IbFvFwb0pm_nHsHVWbmq48KBDXNQ0_tcJM17cN3beJW_fI1PR825ztjlGOsXDjkHmqZ5qd-jMmL45skqk02rjX0sr1UrPIYUTCoSUUNNjXHW_uCZ22rjRAhy4QYOeaT3qeqJaNccl1wCAzZJvz52qGwagaGOJgPzBzza7IaZqwX0S82-ZAvWQ0jKHdC1UJsB9j8eWsmLgXsa1lKdceJKceseyJ-T22g0e6M9HJfM-Y6LMpbbuWp68sXK5Rv9aug2g2kbi2HduJJCN_16g360uR77fOPzw-Pds7HX09r798FLlYT-ct6-G84U2QRGy-k3cXKs4v3MpCFx1pAlvjcl6r8OaBOcL8LptljuLUUTz-
2018-04-16 10:53:10.447357+0200 TestWebView113[2220:919212] CFNetwork Diagnostics [3:10968] 10:53:10.447 {
TCP Connection Start: (null)
Connection: 0x10c8b1240
Connection ID: 18
} [3:10968]
2018-04-16 10:53:10.484738+0200 TestWebView113[2220:919214] [BoringSSL] Function boringssl_session_errorlog: line 2866 [boringssl_session_handshake_continue] SSL_ERROR_SSL(1): operation failed within the library
2018-04-16 10:53:10.486185+0200 TestWebView113[2220:919214] [BoringSSL] Function boringssl_session_handshake_error_print: line 2805 boringssl ctx 0x112c36ba0: 4416619424:error:10000410:SSL routines:OPENSSL_internal:SSLV3_ALERT_HANDSHAKE_FAILURE:/BuildRoot/Library/Caches/com.apple.xbs/Sources/boringssl/boringssl-109.50.14/ssl/tls_record.c:547:SSL alert number 40
2018-04-16 10:53:10.486251+0200 TestWebView113[2220:919214] [BoringSSL] Function boringssl_session_handshake_error_print: line 2805 boringssl ctx 0x112c36ba0: 4416619424:error:1000009a:SSL routines:OPENSSL_internal:HANDSHAKE_FAILURE_ON_CLIENT_HELLO:/BuildRoot/Library/Caches/com.apple.xbs/Sources/boringssl/boringssl-109.50.14/ssl/handshake_client.c:946:
2018-04-16 10:53:10.487026+0200 TestWebView113[2220:919214] [BoringSSL] Function boringssl_context_get_os_status: line 4268 SSL_AD_HANDSHAKE_FAILURE
2018-04-16 10:53:10.512829+0200 TestWebView113[2220:919214] CFNetwork Diagnostics [3:10969] 10:53:10.512 {
TCP Connection Failed: (null)
Connection ID: 18
Error Code: -9824
Error:
} [3:10969]
2018-04-16 10:53:10.512891+0200 TestWebView113[2220:919214] TIC TCP Conn Failed [18:0x10c8b1240]: 3:-9824 Err(-9824)
2018-04-16 10:53:10.513229+0200 TestWebView113[2220:919214] NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9824)
2018-04-16 10:53:10.513362+0200 TestWebView113[2220:919214] Task <96260DF1-7F19-430D-B053-731FB975C573>.<0> HTTP load failed (error code: -1200 [3:-9824])
2018-04-16 10:53:10.514247+0200 TestWebView113[2220:919214] CFNetwork Diagnostics [3:10970] 10:53:10.513 {
Response Error: (null)
Request: <CFURLRequest 0x112c3b4f0 [0x1b3dbe538]> {url = https://idp.clasp-infra.com/adfs/ls/?client-request-id=25e519d0-0862-49b4-9f8c-56c4a41b02d4&wa=wsignin1.0&wtrealm=urn%3afederation%3aMicrosoftOnline&wctx=LoginOptions%3D3%26estsredirect%3d2%26estsrequest%3drQIIAXWSvY_SYADGKdwR7jTnxZh4xoVBF7Xw9uNtKcnF4-PAnlAo0APehZTSQgtvXyzFSkdnh5tvMTEmJudgYhy8Gy9ON12i040mJsbJODkKf4DLM_2GJ8_veRBjUkz2Hs_xUBf7Ei3pAkfzEgNonWcFmoOcwLGAGUDAeTc3ty_v_LjfT3ySX786_PL2bvTbCXV75PvTWTadDoIgRSzLNsyUQXD6M0VdUtRPijqOrlseXWqcRGcCJ0CJFyAUAMtCwHBiCjndRa2lhQpWfVTUoLIAAOEDXGnLsBtqPirLELUPxkpRBoojh0oZTbot-QVyxr7iGGF1yXedYVBpDfnqklewHFRZFVbZfaZWHIZX0Ru13Nwfsasgnh2af6IbFvFwb0pm_nHsHVWbmq48KBDXNQ0_tcJM17cN3beJW_fI1PR825ztjlGOsXDjkHmqZ5qd-jMmL45skqk02rjX0sr1UrPIYUTCoSUUNNjXHW_uCZ22rjRAhy4QYOeaT3qeqJaNccl1wCAzZJvz52qGwagaGOJgPzBzza7IaZqwX0S82-ZAvWQ0jKHdC1UJsB9j8eWsmLgXsa1lKdceJKceseyJ-T22g0e6M9HJfM-Y6LMpbbuWp68sXK5Rv9aug2g2kbi2HduJJCN_16g360uR77fOPzw-Pds7HX09r798FLlYT-c
2018-04-16 10:53:10.523001+0200 TestWebView113[2220:919524] CFNetwork Diagnostics [3:10971] 10:53:10.522 {
Did Fail: (null)
Loader: <CFMutableURLRequest 0x112c0b7d0 [0x1b3dbe538]> {url = https://idp.clasp-infra.com/adfs/ls/?client-request-id=25e519d0-0862-49b4-9f8c-56c4a41b02d4&wa=wsignin1.0&wtrealm=urn%3afederation%3aMicrosoftOnline&wctx=LoginOptions%3D3%26estsredirect%3d2%26estsrequest%3drQIIAXWSvY_SYADGKdwR7jTnxZh4xoVBF7Xw9uNtKcnF4-PAnlAo0APehZTSQgtvXyzFSkdnh5tvMTEmJudgYhy8Gy9ON12i040mJsbJODkKf4DLM_2GJ8_veRBjUkz2Hs_xUBf7Ei3pAkfzEgNonWcFmoOcwLGAGUDAeTc3ty_v_LjfT3ySX786_PL2bvTbCXV75PvTWTadDoIgRSzLNsyUQXD6M0VdUtRPijqOrlseXWqcRGcCJ0CJFyAUAMtCwHBiCjndRa2lhQpWfVTUoLIAAOEDXGnLsBtqPirLELUPxkpRBoojh0oZTbot-QVyxr7iGGF1yXedYVBpDfnqklewHFRZFVbZfaZWHIZX0Ru13Nwfsasgnh2af6IbFvFwb0pm_nHsHVWbmq48KBDXNQ0_tcJM17cN3beJW_fI1PR825ztjlGOsXDjkHmqZ5qd-jMmL45skqk02rjX0sr1UrPIYUTCoSUUNNjXHW_uCZ22rjRAhy4QYOeaT3qeqJaNccl1wCAzZJvz52qGwagaGOJgPzBzza7IaZqwX0S82-ZAvWQ0jKHdC1UJsB9j8eWsmLgXsa1lKdceJKceseyJ-T22g0e6M9HJfM-Y6LMpbbuWp68sXK5Rv9aug2g2kbi2HduJJCN_16g360uR77fOPzw-Pd
2018-04-16 10:53:10.526271+0200 TestWebView113[2220:919524] NSURLConnection finished with error - code -1200
2018-04-16 10:53:10.553551+0200 TestWebView113[2220:919212] CFNetwork Diagnostics [3:10972] 10:53:10.553 {
~HTTPProtocol: nullptr request
Request: null
sent: 0
received: 0
cell sent: 0
cell received: 0
}

Can this be related to my company web page that should display the login/password fields? Is there any recommendation concerning this webpage to make sure the issue does not come from the page? (Should use SSL? All requests should be asynch?... etc)

Best regards

@oldalton
Copy link
Member

@medhaj The issue you're seeing here is different from the issue you reported in the first post (network connection lost vs NSURLErrorSecureConnectionFailed). Please make sure that you're running the test app on the same network and with the same Apple Transport Security settings you're using in your main app. The error here indicates the server has SSL issues or you're on the network with issues (e.g. captive proxy, firewall etc), but it's different from the issue you reported in the first post.

@oldalton
Copy link
Member

ADAL 2.6.3 should solve the issue until Apple releases the fix (https://github.com/AzureAD/azure-activedirectory-library-for-objc/releases/tag/2.6.3)

@medhaj
Copy link
Author

medhaj commented Apr 25, 2018

Thanks @oldalton

I just tested it, the new version is not fixing the issue I am facing.

@oldalton
Copy link
Member

oldalton commented Apr 25, 2018

@medhaj, are you referring to the NSURLErrorSecureConnectionFailed issue? That's a different issue. ADAL 2.6.3 fixes (or works around) connection lost (-1005) issue, when application goes to background.

@medhaj
Copy link
Author

medhaj commented Apr 25, 2018

I am referring the "The network connection was lost." when using ADAL with embedded browser on iOS 11.3. I am still working with our IT department to check if to comes from our internal ADFS service.

@oldalton
Copy link
Member

oldalton commented Apr 26, 2018

@medhaj I recommend you to use CFNetwork diagnostics logging in your project: https://developer.apple.com/library/content/qa/qa1887/_index.html

setenv("CFNETWORK_DIAGNOSTICS", "3", 1);

That way you can see what's up with your connection. If that only started happening on iOS 11.3 and is not clearly a service issue, I suggest you open a bug with Apple for investigation.

The issue we were tracking/fixing was about connection getting lost when app goes to background, which seems different from yours.

@pcrouillere
Copy link

@elsewhat we were facing the same issue with react native. In fact the webview on iOS used by react-native is a really old webview (UIWebview). You should use WKWebview ! And everything will work.

@medhaj Maybe you're facing a similar issue..

@oldalton
Copy link
Member

oldalton commented May 2, 2018

@pcrouillere The issue introduced in iOS 11.3 is also reproducible with WKWebView, because the underlying issue is caused by Apple dropping network connections when app goes to the background. ADAL 2.6.3 works the issue around.

@nkwolf
Copy link

nkwolf commented May 16, 2018

@oldalton, I was having this same "network connection lost" issue, and I upgraded to ADAL 2.6.3 as you recommended and it was resolved. (thank you:) ! )

But now I'm getting these two errors. Could you please advise?

2018-05-16 09:51:04.252516-0700 ERROR: createEncodedCachedResponseAndRequestForXPCTransmission - Invalid protocol-property list - CFURLRequestRef. protoProps={
context = "<ADWebAuthRequest: 0x1c010b7f0>";
}
2018-05-16 09:51:04.252849-0700 ADD: failed to create cache dictionary at path=/private/var/mobile/Containers/Data/Application/DC317F20-EEC2-4152-9DA0-8386E8C02046/Library/Caches/#####. key=0x1c03c04b0

I'm using ios SDK 11.4

@oldalton
Copy link
Member

@SuperVixen The issue you're seeing is a known issue and we've previously seen it on macOS: #1026

We're addressing it during our larger code refactoring, but there shouldn't be any implications to the authentication succeeding due to this particular warning you're seeing. If it's not true and you're seeing authentication failing because of that, please let me know.

@nkwolf
Copy link

nkwolf commented May 16, 2018

Yes, you're totally right. The users are getting authenticated successfully. However, they have to manually enter credentials even if they have the Azure Authenticator app and we use brokered authentication. Is this a side effect ?

@oldalton
Copy link
Member

@SuperVixen I don't think so. I think you're not seeing SSO working.

Are you using brokered authentication (ADCredentialsType == AD_CREDENTIALS_AUTO)?
Are you trying to get SSO working between different apps?

Also, SSO support between different apps through Authenticator app is quite limited for non device joined scenarios. Please refer to documentation here: https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-sso-ios#sso-concepts-in-the-microsoft-identity-platform

@terabytes
Copy link

@pcrouillere The issue introduced in iOS 11.3 is also reproducible with WKWebView, because the underlying issue is caused by Apple dropping network connections when app goes to the background. ADAL 2.6.3 works the issue around.

This is probably true, but the problem (w/ 2FA enabled on my account) appears when I run the simulator with iOS 9.0 too.

image

Simulator settings:
image

Any idea how to get around this? I'd like to test out this React Native Azure AD library. I also need to verify that my Azure AD app registration is working properly.

@oldalton
Copy link
Member

@terabytes The issue described here is -1005 - network connection lost. The issue on your screenshot is -1003 and it says that "a server with the specified hostname could not be found". It's a different issue, if you're confident it's an ADAL issue, please open a separate ticket. Looks like a server or DNS issue to me.

@terabytes
Copy link

terabytes commented May 19, 2018

D'oh! Thanks a bunch for catching that so quickly, @oldalton. You're my digital hero today! 🥇 I have a support ticket with Microsoft open to get this working so hopefully we'll sort this out soon 🙏

Looks like I might have to fix some network settings...

@pvroosendaal
Copy link

@oldalton Finally had the time to test the fix in ADAL 2.6.3. Removed the workaround that @elsewhat suggested earlier and I can confirm the connection lost (-1005) issue, when application goes to background, has been fixed. Thanks so much!

@oldalton
Copy link
Member

Closing this issue as it has been fixed in ADAL 2.6.3.

@aquakul
Copy link

aquakul commented Nov 30, 2018

I used ADAL 2.6.3 and the issue still happens. I believe my issue is similar to OP. In my case, the app never goes to background. We call 'acquireToken' which launches an embedded WebView where user inputs credentials. What we noticed is that although the operation seems to fail (the network lost prompt is shown), seems the token is fetched successfully. Because if we trigger 'acquireToken' again, it just sends us the token with SUCCESS result code. So it's all a bit confusing. Is there any other workaround ??

@aquakul
Copy link

aquakul commented Nov 30, 2018

No luck with the latest version 2.7.6 too. Does this have something to do with how the WebView is embedded in the app.

@venkat-iOS
Copy link

venkat-iOS commented Dec 4, 2019

@oldalton

Objective: we are using company portal app for iOS app deployment and using ADAL, Microsoft Authenticator app for authentication.

Problem : We are facing issue with ADAL with latest iOS version devices below are the specifications.
iOS 13+ & Xcode 11 & Objective C :

We tried with using 'ADAL', '4.0.0' and latest Intune SDK 12.0.18. but after launch the iOS app its not redirecting to the authenticator app to fetch the azure token. before this ADAL update we tested end to end in iOS 12 version devices and it was working.

Also we added com.microsoft.adalcache in Keychain.

Request @oldalton your help on this issue ASAP.

Note : with adal 2.2.7 versions working fine in iOS 12 devices.
Note : we are facing issue with latest iOS 13 and Xcode 11 versions.

Thanks,
Venkat

@oldalton
Copy link
Member

oldalton commented Dec 6, 2019

@venkat-iOS, please make sure you use an iOS 13 compatible ADAL version (4.0.4) and follow steps outlined in this article: https://github.com/AzureAD/azure-activedirectory-library-for-objc/wiki/ADAL-iOS-13-support

This will require you to make some changes for your Info.plist file, as well as your code to support iOS 13.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests