Skip to content

Commit b8f26c5

Browse files
antrix1989Veena11juan-ariasmipetriufengga
authored
Release 1.7.11 (#1146)
* Expose objectId for mam support * Address comments * Fixed json serialize and deserilaize issues found during testing * Add detailed SSO-JIT telemetry: - Add error codes specific for each case - Allow lastError telemetry to use a custom error string * added fix for bckgnd task not stopped in system webview request case * updated location of system webview bknd task stop * Update changelog * Update changelog * Fix a compiling issue with Edge on Mac * Improve logging. (#1142) * Refactor code. (#1143) * Current Telemetry Changes for FLW and Multiple Registrations * Fix formatting issues * Resolved comments * Disable bitcode everywhere * Update changelog. * Update change log * Update change log file * Refactor automation (#1043) * Support resource in automation tests. * Improve automation tests performance. * Refactor tests core. * Remove unused code. * Use file pipeline for simulator. * Revert "Remove unused code." This reverts commit 9cd3b1b. * Revert "Refactor tests core." This reverts commit 27c53e5. * Revert "Improve automation tests performance." This reverts commit cbf1005. * Revert "Support resource in automation tests." This reverts commit 4317159. * Exctract common automation code. * Add dely after cache/keychain clearing. * Fix email typing. * Increase timeout. * Debug tests failure. * Disable CBA automation (#1145) * Improve errors assertion. Co-authored-by: Olga Dalton <[email protected]> * Revert "Merge pull request #1148 from AzureAD/kaisong1990/2073563-disable-bitcode" (#1150) This reverts commit a71be0e, reversing changes made to a68a20b. Co-authored-by: Veena Soman <[email protected]> Co-authored-by: Juan Arias <[email protected]> Co-authored-by: Juan Arias Roldan <[email protected]> Co-authored-by: mipetriu <[email protected]> Co-authored-by: Feng Gao <[email protected]> Co-authored-by: kaisong1990 <[email protected]> Co-authored-by: Swasti Gupta <[email protected]> Co-authored-by: swasti29 <[email protected]> Co-authored-by: Olga Dalton <[email protected]>
1 parent 8bfd623 commit b8f26c5

31 files changed

+1108
-33
lines changed

IdentityCore/IdentityCore.xcodeproj/project.pbxproj

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,8 +419,18 @@
419419
23DADC1020B8BF4F005D7389 /* MSIDAadAuthorityCacheRecord.h in Headers */ = {isa = PBXBuildFile; fileRef = 23DADC0E20B8BF4F005D7389 /* MSIDAadAuthorityCacheRecord.h */; };
420420
23DADC1120B8BF4F005D7389 /* MSIDAadAuthorityCacheRecord.m in Sources */ = {isa = PBXBuildFile; fileRef = 23DADC0F20B8BF4F005D7389 /* MSIDAadAuthorityCacheRecord.m */; };
421421
23E2580A233E7BD1007A38D9 /* MSIDAADV2TokenResponseForV1RequestTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 23E25808233E7BD1007A38D9 /* MSIDAADV2TokenResponseForV1RequestTests.m */; };
422+
23E3A80C289B2952007767BA /* MSIDBaseUITest.m in Sources */ = {isa = PBXBuildFile; fileRef = 23E3A80A289B293F007767BA /* MSIDBaseUITest.m */; };
423+
23E3A80D289B2953007767BA /* MSIDBaseUITest.m in Sources */ = {isa = PBXBuildFile; fileRef = 23E3A80A289B293F007767BA /* MSIDBaseUITest.m */; };
424+
23E3A818289B30F2007767BA /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 23E3A817289B30F2007767BA /* XCTest.framework */; };
425+
23E3A81A289B30FB007767BA /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 23E3A819289B30FB007767BA /* XCTest.framework */; };
426+
23E3A824289B4889007767BA /* XCUIElement+CrossPlat.m in Sources */ = {isa = PBXBuildFile; fileRef = 23E3A822289B4889007767BA /* XCUIElement+CrossPlat.m */; };
427+
23E3A825289B4889007767BA /* XCUIElement+CrossPlat.m in Sources */ = {isa = PBXBuildFile; fileRef = 23E3A822289B4889007767BA /* XCUIElement+CrossPlat.m */; };
428+
23E3A826289B4889007767BA /* XCUIElement+CrossPlat.h in Headers */ = {isa = PBXBuildFile; fileRef = 23E3A823289B4889007767BA /* XCUIElement+CrossPlat.h */; };
422429
23F32F251FFDAF1900B2905E /* MSIDTestBrokerResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = B2D81BBD1FF5C7460093859A /* MSIDTestBrokerResponse.m */; };
423430
23F32F261FFDAF1A00B2905E /* MSIDTestBrokerResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = B2D81BBD1FF5C7460093859A /* MSIDTestBrokerResponse.m */; };
431+
23F48C7C2890C4AC0038E1EA /* MSIDTestsConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = 23F48C7A2890C4AC0038E1EA /* MSIDTestsConfig.h */; };
432+
23F48C7D2890C4AC0038E1EA /* MSIDTestsConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = 23F48C7B2890C4AC0038E1EA /* MSIDTestsConfig.m */; };
433+
23F48C7E2890C4AC0038E1EA /* MSIDTestsConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = 23F48C7B2890C4AC0038E1EA /* MSIDTestsConfig.m */; };
424434
23F9FD4622EC08D800DAB65D /* NSKeyedUnarchiver+MSIDExtensions.h in Headers */ = {isa = PBXBuildFile; fileRef = 23F9FD4422EC08D800DAB65D /* NSKeyedUnarchiver+MSIDExtensions.h */; };
425435
23F9FD4722EC08D800DAB65D /* NSKeyedUnarchiver+MSIDExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 23F9FD4522EC08D800DAB65D /* NSKeyedUnarchiver+MSIDExtensions.m */; };
426436
23F9FD4822EC08D800DAB65D /* NSKeyedUnarchiver+MSIDExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 23F9FD4522EC08D800DAB65D /* NSKeyedUnarchiver+MSIDExtensions.m */; };
@@ -2124,8 +2134,16 @@
21242134
23DADC0E20B8BF4F005D7389 /* MSIDAadAuthorityCacheRecord.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MSIDAadAuthorityCacheRecord.h; sourceTree = "<group>"; };
21252135
23DADC0F20B8BF4F005D7389 /* MSIDAadAuthorityCacheRecord.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MSIDAadAuthorityCacheRecord.m; sourceTree = "<group>"; };
21262136
23E25808233E7BD1007A38D9 /* MSIDAADV2TokenResponseForV1RequestTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MSIDAADV2TokenResponseForV1RequestTests.m; sourceTree = "<group>"; };
2137+
23E3A809289B293F007767BA /* MSIDBaseUITest.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MSIDBaseUITest.h; sourceTree = "<group>"; };
2138+
23E3A80A289B293F007767BA /* MSIDBaseUITest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MSIDBaseUITest.m; sourceTree = "<group>"; };
2139+
23E3A817289B30F2007767BA /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Platforms/iPhoneOS.platform/Developer/Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
2140+
23E3A819289B30FB007767BA /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
2141+
23E3A822289B4889007767BA /* XCUIElement+CrossPlat.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "XCUIElement+CrossPlat.m"; sourceTree = "<group>"; };
2142+
23E3A823289B4889007767BA /* XCUIElement+CrossPlat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "XCUIElement+CrossPlat.h"; sourceTree = "<group>"; };
21272143
23F32F151FF72CE400B2905E /* MSIDMacTokenCacheIntegrationTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MSIDMacTokenCacheIntegrationTests.m; sourceTree = "<group>"; };
21282144
23F32F221FFDAB9D00B2905E /* MSIDTokenCacheDataSourceIntegrationTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MSIDTokenCacheDataSourceIntegrationTests.m; sourceTree = "<group>"; };
2145+
23F48C7A2890C4AC0038E1EA /* MSIDTestsConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MSIDTestsConfig.h; sourceTree = "<group>"; };
2146+
23F48C7B2890C4AC0038E1EA /* MSIDTestsConfig.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MSIDTestsConfig.m; sourceTree = "<group>"; };
21292147
23F9FD4422EC08D800DAB65D /* NSKeyedUnarchiver+MSIDExtensions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSKeyedUnarchiver+MSIDExtensions.h"; sourceTree = "<group>"; };
21302148
23F9FD4522EC08D800DAB65D /* NSKeyedUnarchiver+MSIDExtensions.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSKeyedUnarchiver+MSIDExtensions.m"; sourceTree = "<group>"; };
21312149
23F9FD4922EC097600DAB65D /* NSKeyedArchiver+MSIDExtensions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSKeyedArchiver+MSIDExtensions.h"; sourceTree = "<group>"; };
@@ -3039,13 +3057,15 @@
30393057
isa = PBXFrameworksBuildPhase;
30403058
buildActionMask = 2147483647;
30413059
files = (
3060+
23E3A818289B30F2007767BA /* XCTest.framework in Frameworks */,
30423061
);
30433062
runOnlyForDeploymentPostprocessing = 0;
30443063
};
30453064
B2ED1BB12204D26700A24E82 /* Frameworks */ = {
30463065
isa = PBXFrameworksBuildPhase;
30473066
buildActionMask = 2147483647;
30483067
files = (
3068+
23E3A81A289B30FB007767BA /* XCTest.framework in Frameworks */,
30493069
);
30503070
runOnlyForDeploymentPostprocessing = 0;
30513071
};
@@ -4141,6 +4161,8 @@
41414161
B21FA9D722063C2B00806B68 /* ui_tests_lib */ = {
41424162
isa = PBXGroup;
41434163
children = (
4164+
23F48C7A2890C4AC0038E1EA /* MSIDTestsConfig.h */,
4165+
23F48C7B2890C4AC0038E1EA /* MSIDTestsConfig.m */,
41444166
B248FFA6223C89E800628574 /* lab_api */,
41454167
B27551F7208182BE00AA7A38 /* keyvault */,
41464168
B27551E620817CD400AA7A38 /* MSIDTestConfigurationProvider.h */,
@@ -4149,6 +4171,10 @@
41494171
B2C75908207EE5C900C1FE74 /* MSIDClientCredentialHelper.m */,
41504172
B275520D208186F500AA7A38 /* MSIDAutomation-Bridging-Header.h */,
41514173
B275520A208185E600AA7A38 /* KeyvaultAuthentication.swift */,
4174+
23E3A809289B293F007767BA /* MSIDBaseUITest.h */,
4175+
23E3A80A289B293F007767BA /* MSIDBaseUITest.m */,
4176+
23E3A823289B4889007767BA /* XCUIElement+CrossPlat.h */,
4177+
23E3A822289B4889007767BA /* XCUIElement+CrossPlat.m */,
41524178
);
41534179
path = ui_tests_lib;
41544180
sourceTree = "<group>";
@@ -4978,6 +5004,8 @@
49785004
D6D9A4C21FBE718C00EFA430 /* Frameworks */ = {
49795005
isa = PBXGroup;
49805006
children = (
5007+
23E3A817289B30F2007767BA /* XCTest.framework */,
5008+
23E3A819289B30FB007767BA /* XCTest.framework */,
49815009
963C898C214B98F10051AFEE /* AuthenticationServices.framework */,
49825010
B2BD0A5A2376889600DF6AE4 /* AuthenticationServices.framework */,
49835011
60D6ED0B20D9BB89002FCBBB /* Security.framework */,
@@ -5313,9 +5341,11 @@
53135341
B25315BF23E772B000432133 /* MSIDAutomationOperationAPIInMemoryCacheHandler.h in Headers */,
53145342
B2ED1BBC2204D29400A24E82 /* MSIDAutomationTestRequest.h in Headers */,
53155343
B2ED1BD72204D35C00A24E82 /* MSIDAutomation-Bridging-Header.h in Headers */,
5344+
23F48C7C2890C4AC0038E1EA /* MSIDTestsConfig.h in Headers */,
53165345
B248FFB1223C8F4D00628574 /* MSIDAutomationBaseApiRequest.h in Headers */,
53175346
B248FFA3223C88CC00628574 /* MSIDAutomationTemporaryAccountRequest.h in Headers */,
53185347
B23F2849220E0EDE004ADA72 /* MSIDAutomationResetAPIRequest.h in Headers */,
5348+
23E3A826289B4889007767BA /* XCUIElement+CrossPlat.h in Headers */,
53195349
B253158123E2A67600432133 /* MSIDTestAutomationApplication.h in Headers */,
53205350
B21FA9E022063CFA00806B68 /* MSIDAutomationErrorResult.h in Headers */,
53215351
B25315C423E7782A00432133 /* MSIDAutomationOperationResponseHandler.h in Headers */,
@@ -6200,12 +6230,14 @@
62006230
isa = PBXSourcesBuildPhase;
62016231
buildActionMask = 2147483647;
62026232
files = (
6233+
23E3A80C289B2952007767BA /* MSIDBaseUITest.m in Sources */,
62036234
B2ED1BD52204D35700A24E82 /* MSIDClientCredentialHelper.m in Sources */,
62046235
B248FFD1223D839B00628574 /* MSIDAutomationTemporaryAccountResponseHandler.m in Sources */,
62056236
B2ED1BC12204D2B400A24E82 /* Result.swift in Sources */,
62066237
B2ED1BC72204D2BF00A24E82 /* KeyVaultError.swift in Sources */,
62076238
B21FA9EB22063D1000806B68 /* MSIDAutomationAccountsResult.m in Sources */,
62086239
B248FFAD223C8DF700628574 /* MSIDAutomationPolicyToggleAPIRequest.m in Sources */,
6240+
23E3A824289B4889007767BA /* XCUIElement+CrossPlat.m in Sources */,
62096241
B25315CA23E7A0E800432133 /* MSIDTestAutomationAccountConfigurationRequest.m in Sources */,
62106242
B25315C023E772B000432133 /* MSIDAutomationOperationAPIInMemoryCacheHandler.m in Sources */,
62116243
B248FFA9223C8A9C00628574 /* MSIDAutomationTemporaryAccountRequest.m in Sources */,
@@ -6221,6 +6253,7 @@
62216253
B248FFC3223C97C200628574 /* MSIDAutomationPasswordRequestHandler.m in Sources */,
62226254
B248FFCC223C9C6800628574 /* MSIDAutomationResetOperationResponseHandler.m in Sources */,
62236255
B2ED1BBD2204D29C00A24E82 /* MSIDAutomationTestRequest.m in Sources */,
6256+
23F48C7D2890C4AC0038E1EA /* MSIDTestsConfig.m in Sources */,
62246257
B2C70D68240CA4AB008CD2DE /* MSIDAutomationDeleteDeviceAPIRequest.m in Sources */,
62256258
B25315C523E7782A00432133 /* MSIDAutomationOperationResponseHandler.m in Sources */,
62266259
B23F284A220E0EDE004ADA72 /* MSIDAutomationResetAPIRequest.m in Sources */,
@@ -6239,12 +6272,14 @@
62396272
isa = PBXSourcesBuildPhase;
62406273
buildActionMask = 2147483647;
62416274
files = (
6275+
23E3A80D289B2953007767BA /* MSIDBaseUITest.m in Sources */,
62426276
B2ED1BD62204D35800A24E82 /* MSIDClientCredentialHelper.m in Sources */,
62436277
B248FFD2223D839B00628574 /* MSIDAutomationTemporaryAccountResponseHandler.m in Sources */,
62446278
B2ED1BC22204D2B400A24E82 /* Result.swift in Sources */,
62456279
B2ED1BC82204D2C000A24E82 /* KeyVaultError.swift in Sources */,
62466280
B21FA9EA22063D0F00806B68 /* MSIDAutomationAccountsResult.m in Sources */,
62476281
B248FFAE223C8DF700628574 /* MSIDAutomationPolicyToggleAPIRequest.m in Sources */,
6282+
23E3A825289B4889007767BA /* XCUIElement+CrossPlat.m in Sources */,
62486283
B25315CB23E7A0E800432133 /* MSIDTestAutomationAccountConfigurationRequest.m in Sources */,
62496284
B25315C123E772B000432133 /* MSIDAutomationOperationAPIInMemoryCacheHandler.m in Sources */,
62506285
B248FFA5223C88CC00628574 /* MSIDAutomationTemporaryAccountRequest.m in Sources */,
@@ -6260,6 +6295,7 @@
62606295
B248FFC4223C97C200628574 /* MSIDAutomationPasswordRequestHandler.m in Sources */,
62616296
B248FFCD223C9C6800628574 /* MSIDAutomationResetOperationResponseHandler.m in Sources */,
62626297
B2ED1BBE2204D29C00A24E82 /* MSIDAutomationTestRequest.m in Sources */,
6298+
23F48C7E2890C4AC0038E1EA /* MSIDTestsConfig.m in Sources */,
62636299
B2C70D69240CA4AB008CD2DE /* MSIDAutomationDeleteDeviceAPIRequest.m in Sources */,
62646300
B25315C623E7782A00432133 /* MSIDAutomationOperationResponseHandler.m in Sources */,
62656301
B23F284B220E0EDE004ADA72 /* MSIDAutomationResetAPIRequest.m in Sources */,

IdentityCore/src/MSIDBrokerConstants.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,6 @@ extern NSString * _Nonnull const MSID_BROKER_TYPES_OF_HEADER;
8080
extern NSString * _Nonnull const MSID_ADDITIONAL_EXTENSION_DATA_KEY;
8181
extern NSString * _Nonnull const MSID_SSO_NONCE_QUERY_PARAM_KEY;
8282
extern NSString * _Nonnull const MSID_BROKER_MDM_ID_KEY;
83+
extern NSString * _Nonnull const MSID_ENROLLED_USER_OBJECT_ID_KEY;
84+
extern NSString * _Nonnull const MSID_EXTRA_DEVICE_INFO_KEY;
85+

IdentityCore/src/MSIDBrokerConstants.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,6 @@
7575

7676
NSString *const MSID_ADDITIONAL_EXTENSION_DATA_KEY = @"additional_extension_data";
7777
NSString *const MSID_SSO_NONCE_QUERY_PARAM_KEY = @"sso_nonce";
78-
NSString *const MSID_BROKER_MDM_ID_KEY = @"mdm_id";
78+
NSString *const MSID_BROKER_MDM_ID_KEY = @"mdm_id";
79+
NSString *const MSID_ENROLLED_USER_OBJECT_ID_KEY = @"object_id";
80+
NSString *const MSID_EXTRA_DEVICE_INFO_KEY = @"extraDeviceInfo";

IdentityCore/src/broker_operation/response/MSIDDeviceInfo.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ NS_ASSUME_NONNULL_BEGIN
5050
@property (nonatomic) MSIDWorkPlaceJoinStatus wpjStatus;
5151
@property (nonatomic, nullable) NSString *brokerVersion;
5252
@property (nonatomic) NSDictionary *additionalExtensionData;
53-
// New property to return MDM Id to 1P and managed apps
54-
@property (nonatomic, nullable) NSString *mdmId;
53+
// New property to return additional device Info
54+
@property (nonatomic) NSDictionary *extraDeviceInfo;
5555

5656
- (instancetype)initWithDeviceMode:(MSIDDeviceMode)deviceMode
5757
ssoExtensionMode:(MSIDSSOExtensionMode)ssoExtensionMode

IdentityCore/src/broker_operation/response/MSIDDeviceInfo.m

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,13 @@
2525
#import "MSIDConstants.h"
2626
#import "MSIDWorkPlaceJoinUtil.h"
2727
#import "NSJSONSerialization+MSIDExtensions.h"
28+
#import "MSIDJsonSerializer.h"
2829

2930
static NSArray *deviceModeEnumString;
3031

3132
@implementation MSIDDeviceInfo
3233

34+
3335
- (instancetype)initWithDeviceMode:(MSIDDeviceMode)deviceMode
3436
ssoExtensionMode:(MSIDSSOExtensionMode)ssoExtensionMode
3537
isWorkPlaceJoined:(BOOL)isWorkPlaceJoined
@@ -63,7 +65,13 @@ - (instancetype)initWithJSONDictionary:(NSDictionary *)json error:(__unused NSEr
6365

6466
NSData *jsonData = [json[MSID_ADDITIONAL_EXTENSION_DATA_KEY] dataUsingEncoding:NSUTF8StringEncoding];
6567
_additionalExtensionData = [NSJSONSerialization msidNormalizedDictionaryFromJsonData:jsonData error:nil];
66-
_mdmId = [json msidStringObjectForKey:MSID_BROKER_MDM_ID_KEY];
68+
69+
NSString *extraDeviceInfoStr = [json msidStringObjectForKey:MSID_EXTRA_DEVICE_INFO_KEY];
70+
if (extraDeviceInfoStr)
71+
{
72+
_extraDeviceInfo = [extraDeviceInfoStr msidJson];
73+
}
74+
6775
}
6876

6977
return self;
@@ -78,7 +86,11 @@ - (NSDictionary *)jsonDictionary
7886
json[MSID_BROKER_WPJ_STATUS_KEY] = [self wpjStatusStringFromEnum:self.wpjStatus];
7987
json[MSID_BROKER_BROKER_VERSION_KEY] = self.brokerVersion;
8088
json[MSID_ADDITIONAL_EXTENSION_DATA_KEY] = [self.additionalExtensionData msidJSONSerializeWithContext:nil];
81-
json[MSID_BROKER_MDM_ID_KEY] = self.mdmId;
89+
if (self.extraDeviceInfo)
90+
{
91+
json[MSID_EXTRA_DEVICE_INFO_KEY] = [self.extraDeviceInfo msidJSONSerializeWithContext:nil];
92+
}
93+
8294
return json;
8395
}
8496

IdentityCore/src/cache/key/MSIDDefaultCredentialCacheKey.m

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
#import "MSIDIntuneEnrollmentIdsCache.h"
3030

3131
static NSString *keyDelimiter = @"-";
32-
static NSInteger kCredentialTypePrefix = 2000;
3332

3433
@implementation MSIDDefaultCredentialCacheKey
3534

@@ -106,7 +105,7 @@ - (NSString *)accountIdWithHomeAccountId:(NSString *)homeAccountId
106105

107106
- (NSNumber *)credentialTypeNumber:(MSIDCredentialType)credentialType
108107
{
109-
return @(kCredentialTypePrefix + credentialType);
108+
return [MSIDCredentialTypeHelpers credentialTypeNumber:credentialType];
110109
}
111110

112111
#pragma mark - Public

IdentityCore/src/oauth2/token/MSIDCredentialType.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,15 @@ typedef NS_ENUM(NSInteger, MSIDCredentialType)
3232
MSIDLegacySingleResourceTokenType = 4,
3333
MSIDPrimaryRefreshTokenType = 5,
3434
MSIDLegacyIDTokenType = 6,
35-
MSIDAccessTokenWithAuthSchemeType = 7
35+
MSIDAccessTokenWithAuthSchemeType = 7,
36+
MSIDCredentialTypeLast
3637
};
3738

3839
@interface MSIDCredentialTypeHelpers : NSObject
3940

4041
+ (NSString *)credentialTypeAsString:(MSIDCredentialType)type;
4142
+ (MSIDCredentialType)credentialTypeFromString:(NSString *)type;
4243
+ (MSIDCredentialType)credentialTypeWithRefreshToken:(NSString *)refreshToken accessToken:(NSString *)accessToken;
44+
+ (NSNumber *)credentialTypeNumber:(MSIDCredentialType)credentialType;
4345

4446
@end

IdentityCore/src/oauth2/token/MSIDCredentialType.m

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323

2424
#import "MSIDCredentialType.h"
2525

26+
static NSInteger kCredentialTypePrefix = 2000;
27+
2628
@implementation MSIDCredentialTypeHelpers
2729

2830
+ (NSString *)credentialTypeAsString:(MSIDCredentialType)type
@@ -100,4 +102,9 @@ + (MSIDCredentialType)credentialTypeWithRefreshToken:(NSString *)refreshToken
100102
return MSIDCredentialTypeOther;
101103
}
102104

105+
+ (NSNumber *)credentialTypeNumber:(MSIDCredentialType)credentialType
106+
{
107+
return @(kCredentialTypePrefix + credentialType);
108+
}
109+
103110
@end

IdentityCore/src/telemetry/request_telemetry/MSIDCurrentRequestTelemetry.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,14 @@ typedef NS_ENUM(NSInteger, TokenCacheRefreshType)
5353

5454
@interface MSIDCurrentRequestTelemetry : NSObject <MSIDTelemetryStringSerializable>
5555

56+
- (nullable instancetype)initWithAppId:(NSInteger)appId
57+
tokenCacheRefreshType:(TokenCacheRefreshType)tokenCacheRefreshType
58+
platformFields:(nullable NSMutableArray *)platformFields;
59+
5660
@property (nonatomic) NSInteger schemaVersion;
5761
@property (nonatomic) NSInteger apiId;
5862
@property (nonatomic) TokenCacheRefreshType tokenCacheRefreshType;
63+
@property (nonatomic, nullable) NSMutableArray<NSString *> *platformFields;
5964

6065
@end
6166

IdentityCore/src/telemetry/request_telemetry/MSIDCurrentRequestTelemetry.m

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
#import "MSIDCurrentRequestTelemetry.h"
2727
#import "MSIDCurrentRequestTelemetrySerializedItem.h"
28+
#import "MSIDRequestTelemetryConstants.h"
2829

2930
@implementation MSIDCurrentRequestTelemetry
3031

@@ -35,19 +36,36 @@ - (NSString *)telemetryString
3536
return [self serializeCurrentTelemetryString];
3637
}
3738

39+
#pragma mark - Init
40+
41+
- (nullable instancetype)initWithAppId:(NSInteger)appId
42+
tokenCacheRefreshType:(TokenCacheRefreshType)tokenCacheRefreshType
43+
platformFields:(nullable NSMutableArray *)platformFields
44+
{
45+
self = [super init];
46+
if (self)
47+
{
48+
_schemaVersion = HTTP_REQUEST_TELEMETRY_SCHEMA_VERSION;
49+
_apiId = appId;
50+
_tokenCacheRefreshType = tokenCacheRefreshType;
51+
_platformFields = platformFields;
52+
}
53+
54+
return self;
55+
}
56+
3857
#pragma mark - Private
3958

4059
- (NSString *)serializeCurrentTelemetryString
4160
{
4261
MSIDCurrentRequestTelemetrySerializedItem *currentTelemetryFields = [self createSerializedItem];
43-
4462
return [currentTelemetryFields serialize];
4563
}
4664

4765
- (MSIDCurrentRequestTelemetrySerializedItem *)createSerializedItem
4866
{
4967
NSArray *defaultFields = @[[NSNumber numberWithInteger:self.apiId], [NSNumber numberWithInteger:self.tokenCacheRefreshType]];
50-
return [[MSIDCurrentRequestTelemetrySerializedItem alloc] initWithSchemaVersion:[NSNumber numberWithInteger:self.schemaVersion] defaultFields:defaultFields platformFields:nil];
68+
return [[MSIDCurrentRequestTelemetrySerializedItem alloc] initWithSchemaVersion:[NSNumber numberWithInteger:self.schemaVersion] defaultFields:defaultFields platformFields:self.platformFields];
5169
}
5270

5371
@end

0 commit comments

Comments
 (0)