Azure-Samples / ms-identity-mobile-apple-swift-objc

An iOS sample in Swift that authenticates Microsoft Account and Azure AD users and calls the Graph API using OAuth 2.0
https://aka.ms/aaddev
74 stars 37 forks source link

Sample does not work on iOS 13 #56

Closed sameertotey closed 5 years ago

sameertotey commented 5 years ago

Running the iOS sample app on iOS 12.4 works fine. However while running it on iOS 13.0 or iOS 13.1 phones gives the following error:

Error Domain=MSALErrorDomain Code=-50000 "(null)" UserInfo={MSALErrorDescriptionKey=application did not receive response from broker., MSALInternalErrorCodeKey=-42700}

This error is returned in the completion block of the call to:

- (void)acquireTokenWithParameters:(nonnull MSALInteractiveTokenParameters *)parameters
                   completionBlock:(nonnull MSALCompletionBlock)completionBlock;

https://github.com/AzureAD/microsoft-authentication-library-for-objc/issues/698

sameertotey commented 5 years ago

Fixed by changing the unnecessary check in

 func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool