I've setup a Demo app for ADAL Authentication. Our company request the InTune app installed: https://itunes.apple.com/us/app/intune-company-portal/id719171358?mt=8
After the installation and the setup of InTune, I've installed the demo with ADAL that i've developed:
added ADAL as Pod Library
added redirect URI inside my Azure Portal (https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredApps) (one with schema://bundle_id and one with msauth://code/schema%3A%2F%2Fbundle_id)
added to app's info.plist:
<key>LSApplicationQueriesSchemes</key> <array> <string>msauth</string> </array>
4.added to app's info.plist
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>bundle_id</string>
<key>CFBundleURLSchemes</key>
<array>
<string>schema</string>
</array>
</dict>
</array>
added
[_authContext setCredentialsType:AD_CREDENTIALS_AUTO];to use inTune App Portal for broker auth.create the authentication with:
ADAuthenticationError *error = nil; _authContext = [ADAuthenticationContext authenticationContextWithAuthority:@"https://login.microsoftonline.com/common" error:&error]; [_authContext setCredentialsType:AD_CREDENTIALS_AUTO]; [_authContext acquireTokenWithResource:@"https://graph.microsoft.com" clientId:@"my_client_id" // Comes from App Portal redirectUri:[NSURL URLWithString:@"schema://bundle_id"] // Comes from App Portal completionBlock:^(ADAuthenticationResult *result) { NSLog(result.accessToken); }];
Application will correctly prompt microsoft authentication to the user, that is redirected on microsofth authentication on the company page, but after the Authentication, this is the result:
