Skip to content

Commit 25e504a

Browse files
authored
Merge pull request #936 from AzureAD/release/1.1.3
Release MSAL 1.1.3
2 parents 8f22e7a + dcfcc3b commit 25e504a

25 files changed

+398
-234
lines changed

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
## [1.1.3] - 2020-05-22
2+
3+
### Added
4+
* Support client side telemetry in ESTS requests (#930)
5+
6+
### Fixed
7+
* Add logging for enrollment id mismatch for access tokens (#932)
8+
* Protect legacy macOS cache when MSAL writes into ADAL cache (common core #729)
9+
* Fix NTLM crash when window is not key (common core #724)
10+
* Fixed authority validation for developer known authorities (#913)
11+
* Pass prompt=login for signed out accounts (#919)
12+
* Don't require URL scheme registration in Info.plist for app extensions (#914)
13+
114
## [1.1.2] - 2020-04-17
215

316
### Added

CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# These owners will be the default owners for everything in the repo.
22
# Unless a later match takes precedence, these users will be requested
33
# for review whenever someone opens a pull request.
4-
* @AzureAD/AppleIdentity
4+
* @AzureAD/AppleIdentityTeam
55
# For more details about inheritance patterns, or to assign different
66
# owners for individual file extensions, see:
77
# https://help.github.com/articles/about-codeowners/

MSAL.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "MSAL"
3-
s.version = "1.1.2"
3+
s.version = "1.1.3"
44
s.summary = "Microsoft Authentication Library (MSAL) Preview for iOS"
55

66
s.description = <<-DESC

MSAL/IdentityCore

Submodule IdentityCore updated 100 files

MSAL/resources/ios/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>FMWK</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>1.1.2</string>
18+
<string>1.1.3</string>
1919
<key>CFBundleVersion</key>
2020
<string>$(CURRENT_PROJECT_VERSION)</string>
2121
<key>NSPrincipalClass</key>

MSAL/resources/mac/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>FMWK</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>1.1.2</string>
18+
<string>1.1.3</string>
1919
<key>CFBundleVersion</key>
2020
<string>$(CURRENT_PROJECT_VERSION)</string>
2121
<key>NSHumanReadableCopyright</key>

MSAL/src/MSALDeviceInformation.m

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
#import "MSALDeviceInformation.h"
2929
#import "MSALDeviceInformation+Internal.h"
3030
#import "MSIDDeviceInfo.h"
31+
#import <AuthenticationServices/AuthenticationServices.h>
32+
#import "ASAuthorizationSingleSignOnProvider+MSIDExtensions.h"
3133

3234
NSString *const MSAL_DEVICE_INFORMATION_SSO_EXTENSION_FULL_MODE_KEY = @"isSSOExtensionInFullMode";
3335

@@ -44,6 +46,15 @@ - (instancetype)initWithMSIDDeviceInfo:(MSIDDeviceInfo *)deviceInfo
4446
{
4547
_deviceMode = [self msalDeviceModeFromMSIDMode:deviceInfo.deviceMode];
4648

49+
if (@available(iOS 13.0, macOS 10.15, *))
50+
{
51+
_hasAADSSOExtension = [[ASAuthorizationSingleSignOnProvider msidSharedProvider] canPerformAuthorization];
52+
}
53+
else
54+
{
55+
_hasAADSSOExtension = NO;
56+
}
57+
4758
_extraDeviceInformation = [NSMutableDictionary new];
4859
[self initExtraDeviceInformation:deviceInfo];
4960
}

MSAL/src/MSALPublicClientApplication.m

Lines changed: 47 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@
102102
#import "MSALSignoutParameters.h"
103103
#import "MSALPublicClientApplication+SingleAccount.h"
104104
#import "MSALDeviceInfoProvider.h"
105+
#import "MSIDCurrentRequestTelemetry.h"
105106

106107
@interface MSALPublicClientApplication()
107108
{
@@ -750,8 +751,9 @@ - (void)acquireTokenSilentWithParameters:(MSALSilentTokenParameters *)parameters
750751
}
751752

752753
BOOL shouldValidate = _validateAuthority;
754+
BOOL isDeveloperKnownAuthority = [self shouldExcludeValidationForAuthority:requestAuthority];
753755

754-
if (shouldValidate && [self shouldExcludeValidationForAuthority:requestAuthority])
756+
if (shouldValidate && isDeveloperKnownAuthority)
755757
{
756758
shouldValidate = NO;
757759
}
@@ -776,6 +778,8 @@ - (void)acquireTokenSilentWithParameters:(MSALSilentTokenParameters *)parameters
776778
return;
777779
}
778780

781+
requestAuthority.isDeveloperKnown = isDeveloperKnownAuthority;
782+
779783
NSError *msidError = nil;
780784

781785
MSIDRequestType requestType = [self requestType];
@@ -810,6 +814,10 @@ - (void)acquireTokenSilentWithParameters:(MSALSilentTokenParameters *)parameters
810814
msidParams.providedAuthority = providedAuthority;
811815
msidParams.instanceAware = self.internalConfig.multipleCloudsSupported;
812816
msidParams.keychainAccessGroup = self.internalConfig.cacheConfig.keychainSharingGroup;
817+
msidParams.currentRequestTelemetry = [MSIDCurrentRequestTelemetry new];
818+
msidParams.currentRequestTelemetry.schemaVersion = 2;
819+
msidParams.currentRequestTelemetry.apiId = [msidParams.telemetryApiId integerValue];
820+
msidParams.currentRequestTelemetry.forceRefresh = parameters.forceRefresh;
813821

814822
MSID_LOG_WITH_CTX_PII(MSIDLogLevelInfo, msidParams,
815823
@"-[MSALPublicClientApplication acquireTokenSilentForScopes:%@\n"
@@ -830,19 +838,15 @@ - (void)acquireTokenSilentWithParameters:(MSALSilentTokenParameters *)parameters
830838
parameters.claimsRequest);
831839

832840
// Return early if account is in signed out state
833-
MSALAccountsProvider *accountsProvider = [[MSALAccountsProvider alloc] initWithTokenCache:self.tokenCache
834-
accountMetadataCache:self.accountMetadataCache
835-
clientId:self.internalConfig.clientId
836-
externalAccountProvider:self.externalAccountHandler];
837841
NSError *signInStateError;
838-
MSIDAccountMetadataState signInState = [accountsProvider signInStateForHomeAccountId:msidParams.accountIdentifier.homeAccountId
839-
context:msidParams
840-
error:&signInStateError];
842+
MSIDAccountMetadataState signInState = [self accountStateForParameters:msidParams error:&signInStateError];
841843

842-
if (signInStateError) {
844+
if (signInStateError)
845+
{
843846
block(nil, signInStateError, msidParams);
844847
return;
845848
}
849+
846850
if (signInState == MSIDAccountMetadataStateSignedOut)
847851
{
848852
NSError *interactionError = MSIDCreateError(MSIDErrorDomain, MSIDErrorInteractionRequired, @"Account is signed out, user interaction is required.", nil, nil, nil, msidParams.correlationId, nil, YES);
@@ -888,6 +892,25 @@ - (void)acquireTokenSilentWithParameters:(MSALSilentTokenParameters *)parameters
888892
}];
889893
}
890894

895+
- (MSIDAccountMetadataState)accountStateForParameters:(MSIDRequestParameters *)msidParams error:(NSError **)signInStateError
896+
{
897+
if (!msidParams.accountIdentifier.homeAccountId)
898+
{
899+
return MSIDAccountMetadataStateUnknown;
900+
}
901+
902+
MSALAccountsProvider *accountsProvider = [[MSALAccountsProvider alloc] initWithTokenCache:self.tokenCache
903+
accountMetadataCache:self.accountMetadataCache
904+
clientId:self.internalConfig.clientId
905+
externalAccountProvider:self.externalAccountHandler];
906+
907+
MSIDAccountMetadataState signInState = [accountsProvider signInStateForHomeAccountId:msidParams.accountIdentifier.homeAccountId
908+
context:msidParams
909+
error:signInStateError];
910+
911+
return signInState;
912+
}
913+
891914
- (void)acquireTokenSilentForScopes:(NSArray<NSString *> *)scopes
892915
account:(MSALAccount *)account
893916
completionBlock:(MSALCompletionBlock)completionBlock
@@ -1014,6 +1037,8 @@ - (void)acquireTokenWithParameters:(MSALInteractiveTokenParameters *)parameters
10141037
return;
10151038
}
10161039

1040+
requestAuthority.isDeveloperKnown = [self shouldExcludeValidationForAuthority:requestAuthority];
1041+
10171042
NSError *msidError = nil;
10181043

10191044
MSIDBrokerInvocationOptions *brokerOptions = nil;
@@ -1095,6 +1120,17 @@ - (void)acquireTokenWithParameters:(MSALInteractiveTokenParameters *)parameters
10951120
msidParams.claimsRequest = parameters.claimsRequest.msidClaimsRequest;
10961121
msidParams.providedAuthority = requestAuthority;
10971122
msidParams.shouldValidateResultAccount = YES;
1123+
msidParams.currentRequestTelemetry = [MSIDCurrentRequestTelemetry new];
1124+
msidParams.currentRequestTelemetry.schemaVersion = 2;
1125+
msidParams.currentRequestTelemetry.apiId = [msidParams.telemetryApiId integerValue];
1126+
msidParams.currentRequestTelemetry.forceRefresh = NO;
1127+
1128+
MSIDAccountMetadataState signInState = [self accountStateForParameters:msidParams error:nil];
1129+
1130+
if (signInState == MSIDAccountMetadataStateSignedOut && msidParams.promptType != MSIDPromptTypeConsent)
1131+
{
1132+
msidParams.promptType = MSIDPromptTypeLogin;
1133+
}
10981134

10991135
MSID_LOG_WITH_CTX_PII(MSIDLogLevelInfo, msidParams,
11001136
@"-[MSALPublicClientApplication acquireTokenWithParameters:%@\n"
@@ -1395,9 +1431,6 @@ - (BOOL)shouldExcludeValidationForAuthority:(MSIDAuthority *)authority
13951431
for (MSALAuthority *knownAuthority in self.internalConfig.knownAuthorities)
13961432
{
13971433
if ([authority isKindOfClass:knownAuthority.msidAuthority.class]
1398-
// Treat AAD authorities differently, since they should always succeed validation
1399-
// Therefore, even if they are added to known authorities, still do validation
1400-
&& ![authority isKindOfClass:[MSIDAADAuthority class]]
14011434
&& [knownAuthority.url isEqual:authority.url])
14021435
{
14031436
return YES;
@@ -1419,11 +1452,8 @@ + (NSOrderedSet *)defaultOIDCScopes
14191452

14201453
- (MSIDRequestType)requestType
14211454
{
1422-
MSIDRequestType requestType = MSIDRequestLocalType;
1423-
1424-
#if TARGET_OS_IPHONE
1425-
requestType = MSIDRequestBrokeredType;
1426-
1455+
MSIDRequestType requestType = MSIDRequestBrokeredType;
1456+
14271457
if (MSALGlobalConfig.brokerAvailability == MSALBrokeredAvailabilityNone)
14281458
{
14291459
requestType = MSIDRequestLocalType;
@@ -1432,7 +1462,6 @@ - (MSIDRequestType)requestType
14321462
{
14331463
requestType = MSIDRequestLocalType;
14341464
}
1435-
#endif
14361465

14371466
return requestType;
14381467
}

MSAL/src/MSAL_Internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
#define MSAL_VER_HIGH 1
2929
#define MSAL_VER_LOW 1
30-
#define MSAL_VER_PATCH 2
30+
#define MSAL_VER_PATCH 3
3131

3232
#define STR_HELPER(x) #x
3333
#define STR(x) STR_HELPER(x)

MSAL/src/configuration/MSALGlobalConfig.m

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,10 @@
3232

3333
@implementation MSALGlobalConfig
3434

35+
static MSALBrokeredAvailability s_brokerAvailability = MSALBrokeredAvailabilityAuto;
36+
3537
#if TARGET_OS_IPHONE
3638
static MSALWebviewType s_webviewType = MSALWebviewTypeDefault;
37-
static MSALBrokeredAvailability s_brokerAvailability = MSALBrokeredAvailabilityAuto;
3839
#else
3940
static MSALWebviewType s_webviewType = MSALWebviewTypeWKWebView;
4041
#endif
@@ -58,10 +59,8 @@ + (instancetype)sharedInstance
5859
+ (MSALHTTPConfig *)httpConfig { return MSALGlobalConfig.sharedInstance.httpConfig; }
5960
+ (MSALTelemetryConfig *)telemetryConfig { return MSALGlobalConfig.sharedInstance.telemetryConfig; }
6061
+ (MSALLoggerConfig *)loggerConfig { return MSALGlobalConfig.sharedInstance.loggerConfig; }
61-
#if TARGET_OS_IPHONE
6262
+ (MSALBrokeredAvailability)brokerAvailability { return s_brokerAvailability; }
6363
+ (void)setBrokerAvailability:(MSALBrokeredAvailability)brokerAvailability { s_brokerAvailability = brokerAvailability; }
64-
#endif
6564
+ (MSALWebviewType)defaultWebviewType { return s_webviewType; }
6665
+ (void)setDefaultWebviewType:(MSALWebviewType)defaultWebviewType { s_webviewType = defaultWebviewType; }
6766

0 commit comments

Comments
 (0)