Skip to content

Commit 1c88515

Browse files
authored
Merge pull request #815 from AzureAD/release/1.0.6
[Blocked for release freeze] Release 1.0.6 into master
2 parents c4fd388 + a175c4b commit 1c88515

19 files changed

+288
-64
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## [1.0.6] - 2020-01-03
2+
### Fixed
3+
- Set mobile content type for the WKWebView configuration (#810)
4+
- Better error handling for missing broker query schemes (#811)
5+
- Enable dogfood Authenticator support by default (#812)
6+
- Optimiza external account writing logic (#813)
7+
18
## [1.0.5] - 2019-12-13
29
### Fixed
310
- Account lookup fix when no refresh tokens present (#799)

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.0.5"
3+
s.version = "1.0.6"
44
s.summary = "Microsoft Authentication Library (MSAL) Preview for iOS"
55

66
s.description = <<-DESC

MSAL/MSAL.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,7 @@
549549
B2BB739C2112C7F9000EA4C5 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B2BB739B2112C7F9000EA4C5 /* Security.framework */; };
550550
B2BB739D2112C82E000EA4C5 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B2BB739B2112C7F9000EA4C5 /* Security.framework */; };
551551
B2BDEEE821FEA205001EBB8B /* MSALMultiAppCacheCoexistenceTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B2734C1B21253AD300DAB1CD /* MSALMultiAppCacheCoexistenceTests.m */; };
552+
B2C0E80923AF06DB006C9CAD /* MSALLegacySharedAccountsProvider+Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = B2C0E80723AF06DB006C9CAD /* MSALLegacySharedAccountsProvider+Internal.h */; };
552553
B2C17B071FC8DAC50070A514 /* libIdentityCore.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D6A206231FC50A4D00755A51 /* libIdentityCore.a */; };
553554
B2C17B081FC8DACC0070A514 /* libIdentityCore.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D6A206251FC50A4D00755A51 /* libIdentityCore.a */; };
554555
B2C17B0A1FC8DB2E0070A514 /* MSIDVersion.m in Sources */ = {isa = PBXBuildFile; fileRef = B2C17B091FC8DB2E0070A514 /* MSIDVersion.m */; };
@@ -1228,6 +1229,7 @@
12281229
B2BB73962112C4B3000EA4C5 /* msal__ui_test__ios.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = msal__ui_test__ios.xcconfig; sourceTree = "<group>"; };
12291230
B2BB73982112C51E000EA4C5 /* MSALUITests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MSALUITests.swift; sourceTree = "<group>"; };
12301231
B2BB739B2112C7F9000EA4C5 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.4.sdk/System/Library/Frameworks/Security.framework; sourceTree = DEVELOPER_DIR; };
1232+
B2C0E80723AF06DB006C9CAD /* MSALLegacySharedAccountsProvider+Internal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "MSALLegacySharedAccountsProvider+Internal.h"; sourceTree = "<group>"; };
12311233
B2C17B091FC8DB2E0070A514 /* MSIDVersion.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MSIDVersion.m; sourceTree = "<group>"; };
12321234
B2C2329F21224C21008092C1 /* MSALBlackforestUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MSALBlackforestUITests.m; sourceTree = "<group>"; };
12331235
B2C232AA2122A6A5008092C1 /* MSALCacheRemovalTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MSALCacheRemovalTests.m; sourceTree = "<group>"; };
@@ -1719,6 +1721,7 @@
17191721
B223B0C422AE215D00FB8713 /* MSALLegacySharedAccountFactory.m */,
17201722
B266391922B4B84600FEB673 /* NSString+MSALAccountIdenfiers.h */,
17211723
B266391A22B4B84600FEB673 /* NSString+MSALAccountIdenfiers.m */,
1724+
B2C0E80723AF06DB006C9CAD /* MSALLegacySharedAccountsProvider+Internal.h */,
17221725
);
17231726
path = ios;
17241727
sourceTree = "<group>";
@@ -2497,6 +2500,7 @@
24972500
B29A56C122826EE00023F5E6 /* MSALSerializedADALCacheProvider.h in Headers */,
24982501
96CF95212268FD0400D97374 /* MSALAccount.h in Headers */,
24992502
B267569D228F335E000F01D7 /* MSALExternalAccountHandler.h in Headers */,
2503+
B2C0E80923AF06DB006C9CAD /* MSALLegacySharedAccountsProvider+Internal.h in Headers */,
25002504
B26756C422921C42000F01D7 /* MSALAADOauth2Provider.h in Headers */,
25012505
232D6195224C62FF00260C42 /* MSALIndividualClaimRequest+Internal.h in Headers */,
25022506
B26756BE22921A71000F01D7 /* MSALOauth2Provider.h in Headers */,

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.0.5</string>
18+
<string>1.0.6</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.0.5</string>
18+
<string>1.0.6</string>
1919
<key>CFBundleVersion</key>
2020
<string>$(CURRENT_PROJECT_VERSION)</string>
2121
<key>NSHumanReadableCopyright</key>

MSAL/src/MSALPublicClientApplication.m

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@
9494
#import "MSIDMacKeychainTokenCache.h"
9595
#endif
9696

97+
#import "MSIDTokenResult.h"
9798
#import "MSIDKeychainTokenCache.h"
9899

99100
@interface MSALPublicClientApplication()
@@ -193,6 +194,16 @@ - (instancetype)initWithConfiguration:(MSALPublicClientApplicationConfig *)confi
193194
if (error) *error = [MSALErrorConverter msalErrorFromMsidError:msidError];
194195
return nil;
195196
}
197+
198+
#if TARGET_OS_IPHONE
199+
if (MSALGlobalConfig.brokerAvailability == MSALBrokeredAvailabilityAuto
200+
&& msalRedirectUri.brokerCapable
201+
&& ![MSALRedirectUriVerifier verifyAdditionalRequiredSchemesAreRegistered:&msidError])
202+
{
203+
if (error) *error = [MSALErrorConverter msalErrorFromMsidError:msidError];
204+
return nil;
205+
}
206+
#endif
196207

197208
config.verifiedRedirectUri = msalRedirectUri;
198209

@@ -696,7 +707,13 @@ - (void)acquireTokenSilentWithParameters:(MSALSilentTokenParameters *)parameters
696707

697708
NSError *resultError = nil;
698709
MSALResult *msalResult = [self.msalOauth2Provider resultWithTokenResult:result error:&resultError];
699-
[self updateExternalAccountsWithResult:msalResult context:msidParams];
710+
711+
if (result.tokenResponse)
712+
{
713+
// Only update external accounts if we got new result from network as an optimization
714+
[self updateExternalAccountsWithResult:msalResult context:msidParams];
715+
}
716+
700717
block(msalResult, resultError, msidParams);
701718
}];
702719
}

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 0
30-
#define MSAL_VER_PATCH 5
30+
#define MSAL_VER_PATCH 6
3131

3232
#define STR_HELPER(x) #x
3333
#define STR(x) STR_HELPER(x)
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// Copyright (c) Microsoft Corporation.
2+
// All rights reserved.
3+
//
4+
// This code is licensed under the MIT License.
5+
//
6+
// Permission is hereby granted, free of charge, to any person obtaining a copy
7+
// of this software and associated documentation files(the "Software"), to deal
8+
// in the Software without restriction, including without limitation the rights
9+
// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
10+
// copies of the Software, and to permit persons to whom the Software is
11+
// furnished to do so, subject to the following conditions :
12+
//
13+
// The above copyright notice and this permission notice shall be included in
14+
// all copies or substantial portions of the Software.
15+
//
16+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
// THE SOFTWARE.
23+
24+
#import "MSALLegacySharedAccountsProvider.h"
25+
#import "MSALLegacySharedAccount.h"
26+
27+
NS_ASSUME_NONNULL_BEGIN
28+
29+
@interface MSALLegacySharedAccountsProvider (Internal)
30+
31+
- (void)updateAccountAsync:(id<MSALAccount>)account
32+
idTokenClaims:(nullable NSDictionary *)idTokenClaims
33+
tenantProfiles:(nullable NSArray<MSALTenantProfile *> *)tenantProfiles
34+
operation:(MSALLegacySharedAccountWriteOperation)operation
35+
completion:(void (^)(BOOL result, NSError *error))completion;
36+
37+
@end
38+
39+
NS_ASSUME_NONNULL_END

MSAL/src/configuration/external/ios/MSALLegacySharedAccountsProvider.m

Lines changed: 48 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -184,11 +184,12 @@ - (BOOL)updateAccount:(id<MSALAccount>)account idTokenClaims:(NSDictionary *)idT
184184
{
185185
MSID_LOG_WITH_CTX_PII(MSIDLogLevelInfo, nil, @"Updating account %@", MSID_PII_LOG_MASKABLE(account));
186186

187-
return [self updateAccount:account
188-
idTokenClaims:idTokenClaims
189-
tenantProfiles:nil
190-
operation:MSALLegacySharedAccountUpdateOperation
191-
error:error];
187+
[self updateAccountAsync:account
188+
idTokenClaims:idTokenClaims
189+
tenantProfiles:nil
190+
operation:MSALLegacySharedAccountUpdateOperation
191+
completion:nil];
192+
return YES;
192193
}
193194

194195
- (nullable NSArray<MSALLegacySharedAccount *> *)updatableAccountsFromJsonObject:(NSDictionary *)jsonDictionary
@@ -247,11 +248,29 @@ - (BOOL)removeAccount:(id<MSALAccount>)account
247248
error:(NSError * _Nullable * _Nullable)error
248249
{
249250
MSID_LOG_WITH_CTX_PII(MSIDLogLevelInfo, nil, @"Removing account %@", MSID_PII_LOG_MASKABLE(account));
250-
return [self updateAccount:account
251-
idTokenClaims:nil
252-
tenantProfiles:tenantProfiles
253-
operation:MSALLegacySharedAccountRemoveOperation
254-
error:error];
251+
252+
__block BOOL result = YES;
253+
__block NSError *removeError;
254+
255+
dispatch_barrier_sync(self.synchronizationQueue, ^{
256+
result = [self updateAccountImpl:account
257+
idTokenClaims:nil
258+
tenantProfiles:tenantProfiles
259+
operation:MSALLegacySharedAccountRemoveOperation
260+
error:&removeError];
261+
262+
if (!result)
263+
{
264+
MSID_LOG_WITH_CTX(MSIDLogLevelError, nil, @"Encountered an error updating legacy accounts %@", MSID_PII_LOG_MASKABLE(removeError));
265+
}
266+
});
267+
268+
if (error)
269+
{
270+
*error = removeError;
271+
}
272+
273+
return result;
255274
}
256275

257276
- (nullable NSArray<MSALLegacySharedAccount *> *)removableAccountsFromJsonObject:(NSDictionary *)jsonDictionary
@@ -303,29 +322,27 @@ - (BOOL)removeAccount:(id<MSALAccount>)account
303322

304323
#pragma mark - Write
305324

306-
- (BOOL)updateAccount:(id<MSALAccount>)account
307-
idTokenClaims:(NSDictionary *)idTokenClaims
308-
tenantProfiles:(NSArray<MSALTenantProfile *> *)tenantProfiles
309-
operation:(MSALLegacySharedAccountWriteOperation)operation
310-
error:(NSError **)error
325+
- (void)updateAccountAsync:(id<MSALAccount>)account
326+
idTokenClaims:(NSDictionary *)idTokenClaims
327+
tenantProfiles:(NSArray<MSALTenantProfile *> *)tenantProfiles
328+
operation:(MSALLegacySharedAccountWriteOperation)operation
329+
completion:(void (^)(BOOL result, NSError *error))completion
311330
{
312-
__block BOOL result = YES;
313-
__block NSError *updateError = nil;
314-
315-
dispatch_barrier_sync(self.synchronizationQueue, ^{
316-
result = [self updateAccountImpl:account
317-
idTokenClaims:idTokenClaims
318-
tenantProfiles:tenantProfiles
319-
operation:operation
320-
error:&updateError];
331+
dispatch_barrier_async(self.synchronizationQueue, ^{
332+
NSError *updateError;
333+
BOOL result = [self updateAccountImpl:account
334+
idTokenClaims:idTokenClaims
335+
tenantProfiles:tenantProfiles
336+
operation:operation
337+
error:&updateError];
338+
339+
if (!result)
340+
{
341+
MSID_LOG_WITH_CTX(MSIDLogLevelError, nil, @"Encountered an error updating legacy accounts %@", MSID_PII_LOG_MASKABLE(updateError));
342+
}
343+
344+
if (completion) completion(result, updateError);
321345
});
322-
323-
if (error && updateError)
324-
{
325-
*error = updateError;
326-
}
327-
328-
return result;
329346
}
330347

331348
- (BOOL)updateAccountImpl:(id<MSALAccount>)account

0 commit comments

Comments
 (0)