Skip to content

Commit 4f3ddc7

Browse files
authored
Merge pull request #1171 from AzureAD/hotfix/1.1.13
Hotfix/1.1.13
2 parents 821bbdc + c5cb42e commit 4f3ddc7

File tree

7 files changed

+27
-6
lines changed

7 files changed

+27
-6
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
## [1.1.13] - 2020-12-04
2+
* Adding nil check before assigning error when developers try to get account by username from MSALPublicClientApplication, this will help to prevent a crash when passing in nil as error ponter from the API
3+
14
## [1.1.12] - 2020-12-02
25
* Added cross-cloud B2B support.
36
* Fixed logic to handle links that open in new tab for embedded webview.
4-
* accountForUsername from MSALPublicClientApplication will return nil back when username is nil or empty
7+
* AccountForUsername from MSALPublicClientApplication will return nil back when username is nil or empty, error will be provided if a valid error pointer is passed in via this API
58
* Updated user guide to provide a sample Swift & ObjC code for querying a specific account and return token silently when multiple accounts are present in the cache.
69
* Added client-side fix for the known ADFS PKeyAuth issue. (#1150)
710

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.12"
3+
s.version = "1.1.13"
44
s.summary = "Microsoft Authentication Library (MSAL) Preview for iOS"
55
s.description = <<-DESC
66
The MSAL library preview for iOS gives your app the ability to begin using the Microsoft Cloud by supporting Microsoft Azure Active Directory and Microsoft Accounts in a converged experience using industry standard OAuth2 and OpenID Connect. The library also supports Microsoft Azure B2C for those using our hosted identity management service.

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.12</string>
18+
<string>1.1.13</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
@@ -3,7 +3,7 @@
33
<plist version="1.0">
44
<dict>
55
<key>CFBundleShortVersionString</key>
6-
<string>1.1.12</string>
6+
<string>1.1.13</string>
77
<key>CFBundleIdentifier</key>
88
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
99
<key>NSPrincipalClass</key>

MSAL/src/MSALPublicClientApplication.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,8 +442,12 @@ - (MSALAccount *)accountForUsername:(NSString *)username
442442
MSID_LOG_WITH_CTX_PII(MSIDLogLevelInfo, nil, @"Querying MSAL account for username %@", MSID_PII_LOG_EMAIL(username));
443443
if ([NSString msidIsStringNilOrBlank:username])
444444
{
445+
if (error)
446+
{
447+
*error = MSIDCreateError(MSIDErrorDomain, MSIDErrorInvalidInternalParameter, @"No username is provided", nil, nil, nil, nil, nil, YES);
448+
}
449+
445450
MSID_LOG_WITH_CTX(MSIDLogLevelError, nil, @"username is nil or empty which is unexpected");
446-
*error = MSIDCreateError(MSIDErrorDomain, MSIDErrorInvalidInternalParameter, @"No username is provided", nil, nil, nil, nil, nil, YES);;
447451
return nil;
448452
}
449453

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 12
30+
#define MSAL_VER_PATCH 13
3131

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

MSAL/test/unit/MSALPublicClientApplicationTests.m

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2978,6 +2978,20 @@ - (void)testFetchAccountWithNilUsername_shouldReturnError
29782978
XCTAssertNil(account);
29792979
}
29802980

2981+
- (void)testFetchAccountWithNilUsernameAndNilErrorPointer_shouldNotCrash
2982+
{
2983+
[self msalStoreTokenResponseInCache];
2984+
2985+
NSString *clientId = UNIT_TEST_CLIENT_ID;
2986+
__auto_type application = [[MSALPublicClientApplication alloc] initWithClientId:clientId error:nil];
2987+
application.tokenCache = self.tokenCacheAccessor;
2988+
2989+
NSString *username = nil;
2990+
2991+
__auto_type account = [application accountForUsername:username error:nil];
2992+
XCTAssertNil(account);
2993+
}
2994+
29812995

29822996
#pragma mark - removeAccount
29832997

0 commit comments

Comments
 (0)