Skip to content

Commit 9144888

Browse files
antrix1989kaisong1990gplockeoldaltonhieunguyenmsft
authored
Release 1.1.16 (#1273)
* the ui testing was excuted twice, and remove one (#1245) * Fixed README.md typo * update common lib * update msal * When creating a hotfix branch, a automation should be triggered as well (#1259) * update latest common lib * update common core * Update MSAL to use common lib with throttling feature (#1258) throttling feature * update msal use common core dev (#1265) * Dummy change to trigger Travis CI * Minor logging improvements * Update identitycore * Create release branch. * Update release branch (#1274) * Remove check if access_token is not returned for id_token only scenarios * Changed properties that depended on accessToken to nullable * update common lib * Updated common core * Updated submodule * Addressed comments * Updated submodule * Return empty access token in MSALResult * update change log * Return empty authorization header when access token is empty * Updated UT * Updated changelog * Update common core * Updated changelog * Update changelog. Co-authored-by: Tatsuro Shibamura <[email protected]> Co-authored-by: Olga Dalton <[email protected]> Co-authored-by: HieuNguyen <[email protected]> Co-authored-by: Hieu Nguyen <[email protected]> * Update release branch (#1277) * Update common core. * Trigger new build. Co-authored-by: kaisong1990 <[email protected]> Co-authored-by: Garrison Locke <[email protected]> Co-authored-by: Olga Dalton <[email protected]> Co-authored-by: HieuNguyen <[email protected]> Co-authored-by: Hieu Nguyen <[email protected]> Co-authored-by: Jason Zeng <[email protected]> Co-authored-by: Tatsuro Shibamura <[email protected]>
1 parent fe8c307 commit 9144888

File tree

11 files changed

+63
-17
lines changed

11 files changed

+63
-17
lines changed

CHANGELOG.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
1+
## [1.1.16] - 2021-03-19
2+
* Support empty or nil access token in MSAL token response (#1256)
3+
* Implement throttling.
4+
15
## [1.1.15] - 2021-02-19
26
* Mask EUII in logs (#1206)
3-
* Fixes to ADO release pipeline (#1236)
7+
* Fixes to ADO release pipeline. (#1236)
8+
* Fixed required attributes in SHR of AT Pop. (#1267)
49

510
## [1.1.14] - 2021-01-19
611
* Removed identity core classes from public api (#1158).
712
* Fixed possible deadlock caused by thread explosion (#1175)
813
* Added pipeline configuration to generate framework for SPM & automate MSAL release (#1194)
9-
* Extend iOS background tasks to silent and interactive requests.
14+
* Extend iOS background tasks to silent and interactive requests
1015
* Change order of FRT/MRRT lookup for silent token refreshes
1116

1217
## [1.1.13] - 2020-12-04

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.15"
3+
s.version = "1.1.16"
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/IdentityCore

Submodule IdentityCore updated 89 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.15</string>
18+
<string>1.1.16</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.15</string>
18+
<string>1.1.16</string>
1919
<key>CFBundleVersion</key>
2020
<string>$(CURRENT_PROJECT_VERSION)</string>
2121
<key>NSHumanReadableCopyright</key>

MSAL/src/MSALResult.m

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ @implementation MSALResult
5555

5656
- (NSString *)authorizationHeader
5757
{
58+
if ([NSString msidIsStringNilOrBlank:self.accessToken])
59+
{
60+
return @"";
61+
}
62+
5863
return [self.authScheme getAuthorizationHeader:self.accessToken];
5964
}
6065

@@ -134,21 +139,29 @@ + (MSALResult *)resultWithMSIDTokenResult:(MSIDTokenResult *)tokenResult
134139
account.accountClaims = claims.jsonDictionary;
135140
}
136141

137-
NSString *accessToken = [authScheme getClientAccessToken:tokenResult.accessToken popManager:popManager error:error];
138-
if (!accessToken)
142+
NSString *resultAccessToken = @"";
143+
NSArray *resultScopes = @[];
144+
145+
if (![NSString msidIsStringNilOrBlank:tokenResult.accessToken.accessToken])
139146
{
140-
return nil;
147+
MSID_LOG_WITH_CTX(MSIDLogLevelInfo, nil, @"Parsing result access token");
148+
resultAccessToken = [authScheme getClientAccessToken:tokenResult.accessToken popManager:popManager error:error];
149+
resultScopes = [tokenResult.accessToken.scopes array];
141150
}
142-
143-
return [self resultWithAccessToken:accessToken
151+
else
152+
{
153+
MSID_LOG_WITH_CTX(MSIDLogLevelInfo, nil, @"Access token missing in token result. Continuing without it");
154+
}
155+
156+
return [self resultWithAccessToken:resultAccessToken
144157
expiresOn:tokenResult.accessToken.expiresOn
145158
isExtendedLifetimeToken:tokenResult.extendedLifeTimeToken
146159
tenantId:tenantProfile.tenantId
147160
tenantProfile:tenantProfile
148161
account:account
149162
idToken:tokenResult.rawIdToken
150163
uniqueId:tenantProfile.identifier
151-
scopes:[tokenResult.accessToken.scopes array]
164+
scopes:resultScopes
152165
authority:authority
153166
correlationId:tokenResult.correlationId
154167
authScheme:authScheme];

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 15
30+
#define MSAL_VER_PATCH 16
3131

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

MSAL/src/public/MSALResult.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,17 @@
3939

4040
#pragma mark - Token response
4141

42-
/** The Access Token requested. */
42+
/**
43+
The Access Token requested.
44+
Note that if access token is not returned in token response, this property will be returned as an empty string.
45+
*/
4346
@property (readonly, nonnull) NSString *accessToken;
4447

4548
/**
4649
The time that the access token returned in the Token property ceases to be valid.
4750
This value is calculated based on current UTC time measured locally and the value expiresIn returned from the service
4851
*/
49-
@property (readonly, nonnull) NSDate *expiresOn;
52+
@property (readonly, nullable) NSDate *expiresOn;
5053

5154
/**
5255
Some access tokens have extended lifetime when server is in an unavailable state.

MSAL/test/unit/MSALResultTests.m

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,18 @@ - (void)testMSALResultWithTokenResult_whenValidTokenResult_shouldReturnCorrectAt
192192
XCTAssertEqualObjects(result.account.identifier, @"uid.tenant_id");
193193
XCTAssertNil(result.account.tenantProfiles);
194194
XCTAssertEqualObjects(tokenResult.correlationId.UUIDString, @"00000000-0000-0000-0000-000000000001");
195+
XCTAssertEqualObjects(result.accessToken, @"access_token");
196+
XCTAssertEqualObjects(result.authorizationHeader, @"Bearer access_token");
197+
198+
MSIDAccessToken *emptyAccessToken = nil;
199+
tokenResult.accessToken = emptyAccessToken;
200+
error = nil;
201+
result = [MSALResult resultWithMSIDTokenResult:tokenResult authority:msalAuthority authScheme:[MSALAuthenticationSchemeBearer new] popManager:nil error:&error];
202+
203+
XCTAssertEqualObjects(result.accessToken, @"");
204+
XCTAssertEqualObjects(result.authorizationHeader, @"");
205+
XCTAssertNotNil(result);
206+
XCTAssertNil(error);
195207
}
196208

197209
- (void)testMSALResultWithTokenResult_whenValidTokenResult_shouldReturnCorrectAttributes_PopFlow
@@ -218,6 +230,7 @@ - (void)testMSALResultWithTokenResult_whenValidTokenResult_shouldReturnCorrectAt
218230
MSALResult *result = [MSALResult resultWithMSIDTokenResult:tokenResult authority:msalAuthority authScheme:[self generateAuthSchemePopInstance] popManager:[MSALDevicePopManagerUtil test_initWithValidCacheConfig] error:&error];
219231

220232
XCTAssertNotNil(result);
233+
XCTAssertNil(error);
221234
#pragma clang diagnostic push
222235
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
223236
XCTAssertEqualObjects(result.tenantId, claims.realm);
@@ -232,7 +245,19 @@ - (void)testMSALResultWithTokenResult_whenValidTokenResult_shouldReturnCorrectAt
232245
XCTAssertNotNil(result.account);
233246
XCTAssertEqualObjects(result.account.identifier, @"uid.tenant_id");
234247
XCTAssertNil(result.account.tenantProfiles);
248+
XCTAssertNotNil(result.accessToken);
249+
XCTAssertTrue([result.authorizationHeader hasPrefix:@"Pop "]);
235250
XCTAssertEqualObjects(tokenResult.correlationId.UUIDString, @"00000000-0000-0000-0000-000000000001");
251+
252+
MSIDAccessToken *emptyAccessToken = nil;
253+
tokenResult.accessToken = emptyAccessToken;
254+
error = nil;
255+
result = [MSALResult resultWithMSIDTokenResult:tokenResult authority:msalAuthority authScheme:[self generateAuthSchemePopInstance] popManager:[MSALDevicePopManagerUtil test_initWithValidCacheConfig] error:&error];
256+
257+
XCTAssertEqualObjects(result.accessToken, @"");
258+
XCTAssertEqualObjects(result.authorizationHeader, @"");
259+
XCTAssertNotNil(result);
260+
XCTAssertNil(error);
236261
}
237262

238263
- (MSALAuthenticationSchemePop *) generateAuthSchemePopInstance

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ To signout account from your app, call MSAL's signout API. You can also optional
545545
```swift
546546
let account = .... /* account retrieved above */
547547
548-
let signoutParameters = MSALSignoutParameters(webviewParameters: self.webViewParamaters!)
548+
let signoutParameters = MSALSignoutParameters(webviewParameters: self.webViewParameters!)
549549
signoutParameters.signoutFromBrowser = false
550550
551551
application.signout(with: account, signoutParameters: signoutParameters, completionBlock: {(success, error) in

0 commit comments

Comments
 (0)