Skip to content

Commit a48c780

Browse files
authored
Merge pull request #963 from AzureAD/release/1.1.5
Release MSAL 1.1.5
2 parents 6e39ac9 + 8f19601 commit a48c780

17 files changed

+296
-51
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.5] - 2020-06-19
2+
3+
### Added
4+
* Switch to PkeyAuth on macOS (common library #734)
5+
* Support returning additional WPJ info (#931)
6+
7+
### Fixed
8+
* Fixed PkeyAuth when ADFS challenge is URL encoded (common library #750)
9+
* Fixed CBA handling in MSAL (common library #751)
10+
* Fixed failing unit tests on 10.15 (#760)
11+
* Include correlationID in error response (#908)
12+
13+
114
## [1.1.4] - 2020-06-05
215

316
### Fixed

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

66
s.description = <<-DESC

MSAL/IdentityCore

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

MSAL/src/MSALDeviceInformation+Internal.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ NS_ASSUME_NONNULL_BEGIN
3333

3434
- (instancetype)initWithMSIDDeviceInfo:(MSIDDeviceInfo *)deviceInfo;
3535

36+
- (void)addRegisteredDeviceMetadataInformation:(NSDictionary *)deviceInfoMetadata;
37+
3638
@end
3739

3840
NS_ASSUME_NONNULL_END

MSAL/src/MSALDeviceInformation.m

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,27 @@ @implementation MSALDeviceInformation
3838
NSMutableDictionary *_extraDeviceInformation;
3939
}
4040

41+
- (instancetype)init
42+
{
43+
self = [super init];
44+
45+
if (self)
46+
{
47+
_deviceMode = MSALDeviceModeDefault;
48+
_extraDeviceInformation = [NSMutableDictionary new];
49+
}
50+
51+
return self;
52+
}
53+
4154
- (instancetype)initWithMSIDDeviceInfo:(MSIDDeviceInfo *)deviceInfo
4255
{
4356
self = [super init];
44-
57+
4558
if (self)
4659
{
4760
_deviceMode = [self msalDeviceModeFromMSIDMode:deviceInfo.deviceMode];
48-
61+
4962
if (@available(iOS 13.0, macOS 10.15, *))
5063
{
5164
_hasAADSSOExtension = [[ASAuthorizationSingleSignOnProvider msidSharedProvider] canPerformAuthorization];
@@ -54,11 +67,11 @@ - (instancetype)initWithMSIDDeviceInfo:(MSIDDeviceInfo *)deviceInfo
5467
{
5568
_hasAADSSOExtension = NO;
5669
}
57-
70+
5871
_extraDeviceInformation = [NSMutableDictionary new];
5972
[self initExtraDeviceInformation:deviceInfo];
6073
}
61-
74+
6275
return self;
6376
}
6477

@@ -95,6 +108,11 @@ - (void) initExtraDeviceInformation:(MSIDDeviceInfo *)deviceInfo
95108
[_extraDeviceInformation setValue:deviceInfo.ssoExtensionMode == MSIDSSOExtensionModeFull ? @"Yes" : @"No" forKey:MSAL_DEVICE_INFORMATION_SSO_EXTENSION_FULL_MODE_KEY];
96109
}
97110

111+
- (void) addRegisteredDeviceMetadataInformation:(NSDictionary *)deviceInfoMetadata
112+
{
113+
[_extraDeviceInformation addEntriesFromDictionary:deviceInfoMetadata];
114+
}
115+
98116
- (NSString *)description
99117
{
100118
return [NSString stringWithFormat:@"Device mode %@", self.msalDeviceModeString];

MSAL/src/MSALErrorConverter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,5 @@
3333

3434
+ (NSError *)msalErrorFromMsidError:(NSError *)msidError;
3535
+ (NSError *)msalErrorFromMsidError:(NSError *)msidError classifyErrors:(BOOL)shouldClassifyErrors msalOauth2Provider:(MSALOauth2Provider *)oauth2Provider;
36-
36+
+ (NSError *)msalErrorFromMsidError:(NSError *)msidError classifyErrors:(BOOL)shouldClassifyErrors msalOauth2Provider:(MSALOauth2Provider *)oauth2Provider correlationId:(NSUUID *)correlationId;
3737
@end

MSAL/src/MSALErrorConverter.m

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,14 +135,25 @@ + (NSError *)msalErrorFromMsidError:(NSError *)msidError
135135
+ (NSError *)msalErrorFromMsidError:(NSError *)msidError
136136
classifyErrors:(BOOL)shouldClassifyErrors
137137
msalOauth2Provider:(MSALOauth2Provider *)oauth2Provider
138+
{
139+
return [self msalErrorFromMsidError:msidError
140+
classifyErrors:shouldClassifyErrors
141+
msalOauth2Provider:oauth2Provider
142+
correlationId:nil];
143+
}
144+
145+
+ (NSError *)msalErrorFromMsidError:(NSError *)msidError
146+
classifyErrors:(BOOL)shouldClassifyErrors
147+
msalOauth2Provider:(MSALOauth2Provider *)oauth2Provider
148+
correlationId:(NSUUID *)correlationId
138149
{
139150
return [self errorWithDomain:msidError.domain
140151
code:msidError.code
141152
errorDescription:msidError.userInfo[MSIDErrorDescriptionKey]
142153
oauthError:msidError.userInfo[MSIDOAuthErrorKey]
143154
subError:msidError.userInfo[MSIDOAuthSubErrorKey]
144155
underlyingError:msidError.userInfo[NSUnderlyingErrorKey]
145-
correlationId:msidError.userInfo[MSIDCorrelationIdKey]
156+
correlationId:msidError.userInfo[MSIDCorrelationIdKey] ? : correlationId.UUIDString
146157
userInfo:msidError.userInfo
147158
classifyErrors:shouldClassifyErrors
148159
msalOauth2Provider:oauth2Provider];
@@ -154,7 +165,7 @@ + (NSError *)errorWithDomain:(NSString *)domain
154165
oauthError:(NSString *)oauthError
155166
subError:(NSString *)subError
156167
underlyingError:(NSError *)underlyingError
157-
correlationId:(__unused NSUUID *)correlationId
168+
correlationId:(NSString *)correlationId
158169
userInfo:(NSDictionary *)userInfo
159170
classifyErrors:(BOOL)shouldClassifyErrors
160171
msalOauth2Provider:(MSALOauth2Provider *)oauth2Provider
@@ -201,6 +212,7 @@ + (NSError *)errorWithDomain:(NSString *)domain
201212
msalUserInfo[mappedKey] = userInfo[key];
202213
}
203214

215+
if (!msalUserInfo[MSALCorrelationIDKey] && correlationId) msalUserInfo[MSALCorrelationIDKey] = correlationId;
204216
if (errorDescription) msalUserInfo[MSALErrorDescriptionKey] = errorDescription;
205217
if (oauthError) msalUserInfo[MSALOAuthErrorKey] = oauthError;
206218
if (subError) msalUserInfo[MSALOAuthSubErrorKey] = subError;

MSAL/src/MSALPublicClientApplication.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ + (void)load
128128
MSIDNotifications.webAuthDidFinishLoadNotificationName = MSALWebAuthDidFinishLoadNotification;
129129
MSIDNotifications.webAuthWillSwitchToBrokerAppNotificationName = MSALWebAuthWillSwitchToBrokerApp;
130130
MSIDNotifications.webAuthDidReceiveResponseFromBrokerNotificationName = MSALWebAuthDidReceiveResponseFromBroker;
131-
#if TARGET_OS_IPHONE
131+
#if TARGET_OS_IPHONE && !AD_BROKER
132132
[MSIDCertAuthHandler setUseAuthSession:YES];
133133
#endif
134134
}
@@ -716,7 +716,7 @@ - (void)acquireTokenSilentWithParameters:(MSALSilentTokenParameters *)parameters
716716
{
717717
__auto_type block = ^(MSALResult *result, NSError *msidError, id<MSIDRequestContext> context)
718718
{
719-
NSError *msalError = [MSALErrorConverter msalErrorFromMsidError:msidError classifyErrors:YES msalOauth2Provider:self.msalOauth2Provider];
719+
NSError *msalError = [MSALErrorConverter msalErrorFromMsidError:msidError classifyErrors:YES msalOauth2Provider:self.msalOauth2Provider correlationId:context.correlationId];
720720
[MSALPublicClientApplication logOperation:@"acquireTokenSilent" result:result error:msalError context:context];
721721

722722
if (!completionBlock) return;
@@ -1014,7 +1014,7 @@ - (void)acquireTokenWithParameters:(MSALInteractiveTokenParameters *)parameters
10141014
{
10151015
__auto_type block = ^(MSALResult *result, NSError *msidError, id<MSIDRequestContext> context)
10161016
{
1017-
NSError *msalError = [MSALErrorConverter msalErrorFromMsidError:msidError classifyErrors:YES msalOauth2Provider:self.msalOauth2Provider];
1017+
NSError *msalError = [MSALErrorConverter msalErrorFromMsidError:msidError classifyErrors:YES msalOauth2Provider:self.msalOauth2Provider correlationId:context.correlationId];
10181018
[MSALPublicClientApplication logOperation:@"acquireToken" result:result error:msalError context:context];
10191019

10201020
if (!completionBlock) return;
@@ -1260,7 +1260,7 @@ - (void)signoutWithAccount:(nonnull MSALAccount *)account
12601260
{
12611261
__auto_type block = ^(BOOL result, NSError *msidError, id<MSIDRequestContext> context)
12621262
{
1263-
NSError *msalError = [MSALErrorConverter msalErrorFromMsidError:msidError classifyErrors:YES msalOauth2Provider:self.msalOauth2Provider];
1263+
NSError *msalError = [MSALErrorConverter msalErrorFromMsidError:msidError classifyErrors:YES msalOauth2Provider:self.msalOauth2Provider correlationId:context.correlationId];
12641264

12651265
if (!result)
12661266
{

0 commit comments

Comments
 (0)