Skip to content

Commit 4e5e3b4

Browse files
authored
Merge pull request #1027 from AzureAD/release/1.6.9
Merge release 1.6.9 back to master
2 parents 35f1c5a + ac92351 commit 4e5e3b4

23 files changed

+316
-32
lines changed

IdentityCore/IdentityCore.xcodeproj/project.pbxproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,6 +1187,8 @@
11871187
B286BA03238A091B007833AD /* MSIDDefaultInteractiveTokenRequestTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B2BE923621A0F99C00F5AB8C /* MSIDDefaultInteractiveTokenRequestTests.m */; };
11881188
B286BA06238A110A007833AD /* MSIDOIDCSignoutRequestTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B286BA05238A110A007833AD /* MSIDOIDCSignoutRequestTests.m */; };
11891189
B286BA07238A110A007833AD /* MSIDOIDCSignoutRequestTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B286BA05238A110A007833AD /* MSIDOIDCSignoutRequestTests.m */; };
1190+
B287C4CE26A132FA004303F1 /* MSIDSSOExtensionRequestDelegateTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B287C4CD26A132FA004303F1 /* MSIDSSOExtensionRequestDelegateTests.m */; };
1191+
B287C4CF26A132FA004303F1 /* MSIDSSOExtensionRequestDelegateTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B287C4CD26A132FA004303F1 /* MSIDSSOExtensionRequestDelegateTests.m */; };
11901192
B2893CB11FCF6A8C00E348E9 /* NSMutableDictionary+MSIDExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 23BDA66D1FC78B7E00FE14BE /* NSMutableDictionary+MSIDExtensions.m */; };
11911193
B28AC66421A0BB9D00A1FC4A /* MSIDTestBrokerResponseHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = B28AC66221A0BB9D00A1FC4A /* MSIDTestBrokerResponseHelper.h */; };
11921194
B28AC66521A0BB9D00A1FC4A /* MSIDTestBrokerResponseHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = B28AC66321A0BB9D00A1FC4A /* MSIDTestBrokerResponseHelper.m */; };
@@ -2621,6 +2623,7 @@
26212623
B286B9F3238A002E007833AD /* MSIDTestParametersProvider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MSIDTestParametersProvider.h; sourceTree = "<group>"; };
26222624
B286B9F4238A002E007833AD /* MSIDTestParametersProvider.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MSIDTestParametersProvider.m; sourceTree = "<group>"; };
26232625
B286BA05238A110A007833AD /* MSIDOIDCSignoutRequestTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MSIDOIDCSignoutRequestTests.m; sourceTree = "<group>"; };
2626+
B287C4CD26A132FA004303F1 /* MSIDSSOExtensionRequestDelegateTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MSIDSSOExtensionRequestDelegateTests.m; sourceTree = "<group>"; };
26242627
B2893CAE1FCF68B200E348E9 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.0.sdk/System/Library/Frameworks/Security.framework; sourceTree = DEVELOPER_DIR; };
26252628
B28AC66221A0BB9D00A1FC4A /* MSIDTestBrokerResponseHelper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MSIDTestBrokerResponseHelper.h; sourceTree = "<group>"; };
26262629
B28AC66321A0BB9D00A1FC4A /* MSIDTestBrokerResponseHelper.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MSIDTestBrokerResponseHelper.m; sourceTree = "<group>"; };
@@ -3202,6 +3205,7 @@
32023205
B217861023A57E0700839CE8 /* MSIDSSOExtensionSignoutRequestIntegrationTests.m */,
32033206
B216825B23AB069900F4897A /* MSIDSSOExtensionGetAccountsRequestIntegrationTests.m */,
32043207
B253153C23DD759400432133 /* MSIDSSOExtensionDeviceInfoRequestIntegrationTests.m */,
3208+
B287C4CD26A132FA004303F1 /* MSIDSSOExtensionRequestDelegateTests.m */,
32053209
);
32063210
path = integration;
32073211
sourceTree = "<group>";
@@ -6281,6 +6285,7 @@
62816285
B27CCDD5229EF2C000CAD565 /* MSIDDictionaryExtensionsTests.m in Sources */,
62826286
B2DD4B3120A8DA0B0047A66E /* MSIDLegacyCacheQueryTests.m in Sources */,
62836287
B20E3CB21FC4FA550029C097 /* MSIDVersion.m in Sources */,
6288+
B287C4CE26A132FA004303F1 /* MSIDSSOExtensionRequestDelegateTests.m in Sources */,
62846289
B29A36BB20AFAB0200427B63 /* MSIDDefaultAccessorSSOIntegrationTests.m in Sources */,
62856290
B2DD4B3820A922170047A66E /* MSIDDefaultAccountCacheQueryTests.m in Sources */,
62866291
B2936F4A20AA8E1F0050C585 /* MSIDCacheItemJsonSerializerTests.m in Sources */,
@@ -6719,6 +6724,7 @@
67196724
A08D0A3E24A85C9900C9193D /* MSIDDevicePopManagerTest.m in Sources */,
67206725
B2807FFC204CB16B00944D89 /* MSIDHelperTests.m in Sources */,
67216726
B26A0B9A2072BABE006BD95A /* MSIDAADV2Oauth2FactoryTests.m in Sources */,
6727+
B287C4CF26A132FA004303F1 /* MSIDSSOExtensionRequestDelegateTests.m in Sources */,
67226728
60BF06052051F9A200DE7C1C /* MSIDTelemetryTestDispatcher.m in Sources */,
67236729
233E970622656EB0007FCE2A /* MSIDTelemetryAggregatedTests.m in Sources */,
67246730
B2DD4B3E20A9270B0047A66E /* MSIDDefaultCredentialCacheQueryTests.m in Sources */,

IdentityCore/src/MSIDError.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ extern NSString * _Nonnull MSIDOAuthErrorDomain;
4343
extern NSString * _Nonnull MSIDKeychainErrorDomain;
4444
extern NSString * _Nonnull MSIDHttpErrorCodeDomain;
4545

46+
extern NSExceptionName const _Nonnull MSIDGenericException;
47+
4648
/*!
4749
List of scopes that were requested from MSAL, but not granted in the response.
4850
@@ -256,3 +258,5 @@ extern MSIDErrorCode MSIDErrorCodeForOAuthError(NSString * _Nullable oauthError,
256258
extern NSDictionary<NSString *, NSArray *> * _Nonnull MSIDErrorDomainsAndCodes(void);
257259

258260
extern void MSIDFillAndLogError(NSError * _Nullable __autoreleasing * _Nullable error, MSIDErrorCode errorCode, NSString * _Nullable errorDescription, NSUUID * _Nullable correlationID);
261+
262+
#define MSIDException(name, message, info) [NSException exceptionWithName:name reason:[NSString stringWithFormat:@"%@ (function:%s line:%i)", message, __PRETTY_FUNCTION__, __LINE__] userInfo:info]

IdentityCore/src/MSIDError.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@
4343
NSString *MSIDInvalidTokenResultKey = @"MSIDInvalidTokenResultKey";
4444
NSInteger const MSIDSSOExtensionUnderlyingError = -6000;
4545

46+
NSExceptionName const MSIDGenericException = @"MSIDGenericException";
47+
4648
NSError *MSIDCreateError(NSString *domain, NSInteger code, NSString *errorDescription, NSString *oauthError, NSString *subError, NSError *underlyingError, NSUUID *correlationId, NSDictionary *additionalUserInfo, BOOL logErrorDescription)
4749
{
4850
id<MSIDErrorConverting> errorConverter = MSIDErrorConverter.errorConverter;

IdentityCore/src/cache/MSIDKeychainTokenCache.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ + (void)setDefaultKeychainGroup:(NSString *)defaultKeychainGroup
7171
{
7272
MSID_LOG_WITH_CTX(MSIDLogLevelError, nil, @"Failed to set default keychain group, default keychain cache has already been instantiated.");
7373

74-
@throw @"Attempting to change the keychain group once AuthenticationContexts have been created or the default keychain cache has been retrieved is invalid. The default keychain group should only be set once for the lifetime of an application.";
74+
@throw MSIDException(MSIDGenericException, @"Attempting to change the keychain group once AuthenticationContexts have been created or the default keychain cache has been retrieved is invalid. The default keychain group should only be set once for the lifetime of an application.", nil);
7575
}
7676

7777
MSID_LOG_WITH_CTX_PII(MSIDLogLevelInfo, nil, @"Setting default keychain group to %@", MSID_PII_LOG_MASKABLE(defaultKeychainGroup));

IdentityCore/src/cache/mac/MSIDMacKeychainTokenCache.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ + (void)setDefaultKeychainGroup:(NSString *)defaultKeychainGroup
333333
{
334334
MSID_LOG_WITH_CTX(MSIDLogLevelError, nil, @"Failed to set default keychain group, default keychain cache has already been instantiated.");
335335

336-
@throw @"Attempting to change the keychain group once AuthenticationContexts have been created or the default keychain cache has been retrieved is invalid. The default keychain group should only be set once for the lifetime of an application.";
336+
@throw MSIDException(MSIDGenericException, @"Attempting to change the keychain group once AuthenticationContexts have been created or the default keychain cache has been retrieved is invalid. The default keychain group should only be set once for the lifetime of an application.", nil);
337337
}
338338

339339
MSID_LOG_WITH_CTX_PII(MSIDLogLevelInfo, nil, @"Setting default keychain group to %@", MSID_PII_LOG_MASKABLE(defaultKeychainGroup));

IdentityCore/src/logger/MSIDLogger.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ - (void)setCallback:(MSIDLogCallback)callback
7777
{
7878
if (_callback != nil)
7979
{
80-
@throw @"MSID logging callback can only be set once per process and should never changed once set.";
80+
@throw MSIDException(MSIDGenericException, @"MSID logging callback can only be set once per process and should never changed once set.", nil);
8181
}
8282

8383
static dispatch_once_t once;

IdentityCore/src/oauth2/MSIDOauth2Factory.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ @implementation MSIDOauth2Factory
5252

5353
+ (MSIDProviderType)providerType
5454
{
55-
@throw @"Abstract method was invoked.";
55+
@throw MSIDException(MSIDGenericException, @"Abstract method was invoked.", nil);
5656
}
5757

5858
#pragma mark - Response

IdentityCore/src/oauth2/MSIDTokenResponse.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ - (MSIDErrorCode)oauthErrorCode
123123

124124
+ (MSIDProviderType)providerType
125125
{
126-
@throw @"Abstract method was invoked.";
126+
@throw MSIDException(MSIDGenericException, @"Abstract method was invoked.", nil);
127127
}
128128

129129
#pragma mark - Protected

IdentityCore/src/requests/broker/MSIDSSOExtensionGetAccountsRequest.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,15 @@ - (void)executeRequestWithCompletion:(nonnull MSIDGetAccountsRequestCompletionBl
115115
NSError *error;
116116
ASAuthorizationSingleSignOnRequest *ssoRequest = [self.ssoProvider createSSORequestWithOperationRequest:getAccountsRequest
117117
requestParameters:self.requestParameters
118+
requiresUI:NO
118119
error:&error];
119120

120121
if (!ssoRequest)
121122
{
122123
completionBlock(nil, NO, error);
123124
return;
124125
}
125-
126+
126127
self.authorizationController = [self controllerWithRequest:ssoRequest];
127128
self.authorizationController.delegate = self.extensionDelegate;
128129
[self.authorizationController performRequests];

IdentityCore/src/requests/broker/MSIDSSOExtensionGetDeviceInfoRequest.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,15 @@ - (void)executeRequestWithCompletion:(nonnull MSIDGetDeviceInfoRequestCompletion
100100
NSError *error;
101101
ASAuthorizationSingleSignOnRequest *ssoRequest = [self.ssoProvider createSSORequestWithOperationRequest:getDeviceInfoRequest
102102
requestParameters:self.requestParameters
103+
requiresUI:NO
103104
error:&error];
104105

105106
if (!ssoRequest)
106107
{
107108
completionBlock(nil, error);
108109
return;
109110
}
110-
111+
111112
self.authorizationController = [self controllerWithRequest:ssoRequest];
112113
self.authorizationController.delegate = self.extensionDelegate;
113114
[self.authorizationController performRequests];

0 commit comments

Comments
 (0)