Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/1.8.0 #1475

Merged
merged 60 commits into from
Feb 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
1abd818
Add temp test adjust
antonioalwan Oct 23, 2024
7cc3a47
Test addition 4
antonioalwan Oct 30, 2024
757ffd1
automation tests addition 6
antonioalwan Oct 31, 2024
54f1113
Support web_page_uri.
antrix1989 Nov 7, 2024
ea7c04a
Merge branch 'dev' into sedemche/web_page_uri
antrix1989 Nov 9, 2024
b931705
Merge pull request #1445 from AzureAD/veena/merge_rel_1.7.43_dev
Veena11 Nov 20, 2024
fdddf08
Make upn hash case insensitive
ameyapat Nov 22, 2024
3f1588a
Merge pull request #1446 from AzureAD/ameyapat/make-upn-hash-case-ins…
ameyapat Nov 22, 2024
5ca20e3
Use older version of xcpretty
juan-arias Nov 22, 2024
fc1356d
Minor automation tweaks
Nov 26, 2024
8f9c198
Fix cookie clearing
Nov 26, 2024
5ec6761
Merge pull request #1447 from AzureAD/jarias/use-older-xcpretty
juan-arias Nov 27, 2024
b66b616
Merge remote-tracking branch 'origin/dev' into oldalton/automation_tw…
Nov 27, 2024
5ab5435
Merge pull request #1448 from AzureAD/oldalton/automation_tweaks
oldalton Nov 27, 2024
b9d2bce
MSA Automation support
Dec 3, 2024
77b8b96
Add more cases
antonioalwan Dec 6, 2024
8616f50
Merge branch 'dev' into antonioalwan/15_add_temp_tests_adj
antonioalwan Dec 9, 2024
b9e400f
Merge pull request #1449 from AzureAD/oldalton/msa_automation_support
oldalton Dec 10, 2024
e6ba073
wait inorder
Dec 12, 2024
0cff59b
Increase waiting time
Dec 12, 2024
b043a5f
Update API
Dec 12, 2024
9d5c425
dummy change to trigger pipeline
kaisong1990 Dec 13, 2024
056ed89
Merge pull request #1454 from AzureAD/kasong/improve-ui-element-checker
kaisong1990 Dec 13, 2024
c734662
Add new error mapping for http error code 403 and 404
Veena11 Dec 18, 2024
ef4d680
update the error name
Veena11 Dec 18, 2024
f75169d
Merge Hotfix/1.7.44 (#1456) (#1459)
antrix1989 Dec 20, 2024
207903d
Merge branch 'dev' into antonioalwan/15_add_temp_tests_adj
antonioalwan Jan 2, 2025
4b7f183
Uninstall xcpretty version 0.4.0 before installing version 0.3.0
juan-arias Jan 7, 2025
9e6616a
Merge pull request #1460 from AzureAD/jarias/uninstall-xcpretty-v0.4.…
juan-arias Jan 8, 2025
13f4bca
Fix crash due to null value being added to set
Veena11 Jan 10, 2025
3ff8a24
Add tests
Veena11 Jan 10, 2025
427d4fa
Add new errors for passkey biometric policy mismatch and invalid pas…
Veena11 Jan 13, 2025
a1c9345
Merge pull request #1437 from AzureAD/antonioalwan/15_add_temp_tests_adj
antonioalwan Jan 13, 2025
2143028
Merge pull request #1457 from AzureAD/veena/fixHttpErrorMapping
Veena11 Jan 14, 2025
e6220cb
added new broker submodule check yml and replaced code in msal check …
mipetriu Jan 14, 2025
aa232cc
revert testing changes in msal submodule check and update wpj openssl…
mipetriu Jan 15, 2025
2b3b0a7
Merge pull request #1463 from AzureAD/mipetriu/broker_submodule_check…
mipetriu Jan 15, 2025
e739d3d
add global constant for camera suppression
mipetriu Jan 17, 2025
d773e62
Merge branch 'dev' into mipetriu/camera_consent_suppress
mipetriu Jan 17, 2025
edd3fbd
add check for camera in prompt suppression check
mipetriu Jan 17, 2025
67f7022
add one more new pSSO error
Veena11 Jan 17, 2025
03314fc
Add PSSO registration needs repair status in getDeviceInfo psso status
Veena11 Jan 17, 2025
329a6a5
add macos version restriction
mipetriu Jan 22, 2025
bf53eee
Merge branch 'dev' into veena/addPSSORepairStatus
Veena11 Jan 22, 2025
e2cb149
Merge branch 'dev' into veena/PasskeyBiometric
Veena11 Jan 22, 2025
689b7c3
Merge branch 'dev' into veena/fixCrash
Veena11 Jan 22, 2025
3ae702e
Merge pull request #1461 from AzureAD/veena/fixCrash
Veena11 Jan 22, 2025
cbb0418
Merge branch 'dev' into mipetriu/camera_consent_suppress
mipetriu Jan 22, 2025
e4203f0
Merge pull request #1465 from AzureAD/veena/addPSSORepairStatus
Veena11 Jan 22, 2025
013d4dc
Merge branch 'dev' into mipetriu/camera_consent_suppress
mipetriu Jan 22, 2025
bf40bc5
Merge pull request #1462 from AzureAD/veena/PasskeyBiometric
Veena11 Jan 23, 2025
430c215
Merge branch 'dev' into mipetriu/camera_consent_suppress
mipetriu Jan 23, 2025
1832c6c
Merge pull request #1464 from AzureAD/mipetriu/camera_consent_suppress
mipetriu Jan 24, 2025
e9e5616
Add new psso error
Veena11 Jan 25, 2025
a00e8b5
Merge pull request #1471 from AzureAD/veena/NewPSSOError
Veena11 Jan 27, 2025
7fd5f1b
Update changelog.txt
Jan 28, 2025
5b95df0
Merge branch 'main' into release/1.7.45
Jan 28, 2025
e4aed05
Update change log
Jan 28, 2025
9677078
Split dummy test id token to avoid getting it flagged as a secret.
juan-arias Jan 31, 2025
67a3a48
Merge pull request #1476 from AzureAD/jarias/fix-test-token-flagging
juan-arias Jan 31, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions IdentityCore/src/MSIDBrokerConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,5 @@ extern NSString * _Nonnull const MSID_CREATE_NEW_URL_SESSION;
extern NSString * _Nonnull const MSID_HTTP_CONNECTION_VALUE;
extern NSString * _Nonnull const MSID_FORCE_REFRESH_KEY;

extern BOOL MSID_SUPPRESS_CAMERA_CONSENT_PROMPT_IN_WEBVIEW;

3 changes: 3 additions & 0 deletions IdentityCore/src/MSIDBrokerConstants.m
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,6 @@
// Http header
NSString *const MSID_HTTP_CONNECTION = @"Connection";
NSString *const MSID_HTTP_CONNECTION_VALUE = @"close";

// Non-constant
BOOL MSID_SUPPRESS_CAMERA_CONSENT_PROMPT_IN_WEBVIEW = NO;
20 changes: 20 additions & 0 deletions IdentityCore/src/MSIDError.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ typedef NS_ENUM(NSInteger, MSIDErrorCode)
*/

MSIDErrorServerUnhandledResponse = -51500,
// http status Code 403 or 404
MSIDErrorUnexpectedHttpResponse = -51501,

/*!
=========================================================
Expand Down Expand Up @@ -334,6 +336,24 @@ typedef NS_ENUM(NSInteger, MSIDErrorCode)

// JIT - Error Handling config invalid or not found
MSIDErrorJITErrorHandlingConfigNotFound = -51839,

// Error is thrown when PSSO biometric policy flag mismatches with the config value
MSIDErrorPSSOBiometricPolicyMismatch = -51840,

// Error is thrown when non ENtra passkey extension tries to access the passkey
MSIDErrorPSSOInvalidPasskeyExtension = -51841,

// Error thrown when psso save login config operation fails
MSIDErrorPSSOSaveLoginConfigFailure = -51842,

// Error is thrown when passkey accessed without biometric when h/w biometric policy configured
MSIDErrorPSSOPasskeyLAError = -51843,

// Error is thrown when PSSO user registration attempted with no biometrics configured and sekey biometric policy is configured
MSIDErrorPSSOBiometricsNotEnrolled = -51844,

// Error is thrown when PSSO user registration attempted with no biometrics available and sekey biometric policy is configured
MSIDErrorPSSOBiometricsNotAvailable = -51845,

// Throttling errors
MSIDErrorThrottleCacheNoRecord = -51900,
Expand Down
23 changes: 22 additions & 1 deletion IdentityCore/src/MSIDError.m
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,12 @@ MSIDErrorCode MSIDErrorCodeForOAuthErrorWithSubErrorCode(NSString *oauthError, M
@(MSIDErrorDeviceNotPSSORegistered),
@(MSIDErrorPSSOKeyIdMismatch),
@(MSIDErrorJITErrorHandlingConfigNotFound),
@(MSIDErrorPSSOBiometricPolicyMismatch),
@(MSIDErrorPSSOInvalidPasskeyExtension),
@(MSIDErrorPSSOSaveLoginConfigFailure),
@(MSIDErrorPSSOPasskeyLAError),
@(MSIDErrorPSSOBiometricsNotEnrolled),
@(MSIDErrorPSSOBiometricsNotAvailable),
],
MSIDOAuthErrorDomain : @[// Server Errors
@(MSIDErrorServerOauth),
Expand All @@ -224,7 +230,8 @@ MSIDErrorCode MSIDErrorCodeForOAuthErrorWithSubErrorCode(NSString *oauthError, M
@(MSIDErrorServerError),
],
MSIDHttpErrorCodeDomain : @[
@(MSIDErrorServerUnhandledResponse)
@(MSIDErrorServerUnhandledResponse),
@(MSIDErrorUnexpectedHttpResponse)
]

// TODO: add new codes here
Expand Down Expand Up @@ -301,6 +308,8 @@ void MSIDFillAndLogError(NSError **error, MSIDErrorCode errorCode, NSString *err
// HTTP errors
case MSIDErrorServerUnhandledResponse:
return @"MSIDErrorServerUnhandledResponse";
case MSIDErrorUnexpectedHttpResponse:
return @"MSIDErrorUnexpectedHttpResponse";
// Authority validation errors
case MSIDErrorAuthorityValidation:
return @"MSIDErrorAuthorityValidation";
Expand Down Expand Up @@ -415,6 +424,18 @@ void MSIDFillAndLogError(NSError **error, MSIDErrorCode errorCode, NSString *err
return @"MSIDErrorDeviceNotPSSORegistered";
case MSIDErrorPSSOKeyIdMismatch:
return @"MSIDErrorPSSOKeyIdMismatch";
case MSIDErrorPSSOBiometricPolicyMismatch:
return @"MSIDErrorPSSOBiometricPolicyMismatch";
case MSIDErrorPSSOInvalidPasskeyExtension:
return @"MSIDErrorPSSOInvalidPasskeyExtension";
case MSIDErrorPSSOSaveLoginConfigFailure:
return @"MSIDErrorPSSOSaveLoginConfigFailure";
case MSIDErrorPSSOPasskeyLAError:
return @"MSIDErrorPSSOPasskeyLAError";
case MSIDErrorPSSOBiometricsNotEnrolled:
return @"MSIDErrorPSSOBiometricsNotEnrolled";
case MSIDErrorPSSOBiometricsNotAvailable:
return @"MSIDErrorPSSOBiometricsNotAvailable";
// Throttling errors
case MSIDErrorThrottleCacheNoRecord:
return @"MSIDErrorThrottleCacheNoRecord";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ typedef NS_ENUM(NSInteger, MSIDPlatformSSOStatus)
MSIDPlatformSSONotEnabled = 0, //Platform SSO Not enabled in SSO Config
MSIDPlatformSSOEnabledNotRegistered = 1, //Platform SSO Enabled in sso config , but not Registered
MSIDPlatformSSOEnabledAndRegistered = 2, //Platform SSO Enabled in sso config and registered
MSIDPlatformSSORegistrationNeedsRepair = 3, //Platform registration needs to be repaired
};

typedef NS_ENUM(NSInteger, MSIDPreferredAuthMethod)
Expand Down
3 changes: 3 additions & 0 deletions IdentityCore/src/broker_operation/response/MSIDDeviceInfo.m
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ - (NSString *)platformSSOStatusStringFromEnum:(MSIDPlatformSSOStatus)platformSSO
return @"platformSSOEnabledNotRegistered";
case MSIDPlatformSSOEnabledAndRegistered:
return @"platformSSOEnabledAndRegistered";
case MSIDPlatformSSORegistrationNeedsRepair:
return @"platformSSORegistrationNeedsRepair";

default:
return nil;
Expand All @@ -187,6 +189,7 @@ - (MSIDPlatformSSOStatus)platformSSOStatusEnumFromString:(NSString *)platformSSO
if ([platformSSOStatusString isEqualToString:@"platformSSONotEnabled"]) return MSIDPlatformSSONotEnabled;
if ([platformSSOStatusString isEqualToString:@"platformSSOEnabledNotRegistered"]) return MSIDPlatformSSOEnabledNotRegistered;
if ([platformSSOStatusString isEqualToString:@"platformSSOEnabledAndRegistered"]) return MSIDPlatformSSOEnabledAndRegistered;
if ([platformSSOStatusString isEqualToString:@"platformSSORegistrationNeedsRepair"]) return MSIDPlatformSSORegistrationNeedsRepair;

return MSIDPlatformSSONotEnabled;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1277,7 +1277,10 @@ - (BOOL)saveAccount:(MSIDAccount *)account
}
else
{
[noReturnAccountsSet addObject:accountCacheItem.username];
if (accountCacheItem.username)
{
[noReturnAccountsSet addObject:accountCacheItem.username];
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion IdentityCore/src/logger/MSIDMaskedUsernameLogParameter.m
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ - (NSString *)maskedDescription
domain = [stringValue substringFromIndex:emailIndex.location + 1];
}

return [NSString stringWithFormat:@"auth.placeholder-%@__%@", [username msidSecretLoggingHash], domain];
return [NSString stringWithFormat:@"auth.placeholder-%@__%@", [username.lowercaseString msidSecretLoggingHash], domain.lowercaseString];
}

return [self.parameterValue msidSecretLoggingHash];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,13 @@ - (void)handleError:(NSError *)error
}
}

NSError *httpError = MSIDCreateError(MSIDHttpErrorCodeDomain, MSIDErrorServerUnhandledResponse, errorDescription, nil, nil, nil, context.correlationId, additionalInfo, YES);
NSError *httpUnderlyingError = nil;
if (httpResponse.statusCode == 403 || httpResponse.statusCode == 404)
{
httpUnderlyingError = MSIDCreateError(MSIDHttpErrorCodeDomain, MSIDErrorUnexpectedHttpResponse, errorDescription, nil, nil, nil, context.correlationId, nil, YES);
}

NSError *httpError = MSIDCreateError(MSIDHttpErrorCodeDomain, MSIDErrorServerUnhandledResponse, errorDescription, nil, nil, httpUnderlyingError, context.correlationId, additionalInfo, YES);

if (completionBlock) completionBlock(nil, httpError);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
typedef void (^MSIDNavigationResponseBlock)(NSHTTPURLResponse *response);

@interface MSIDOAuth2EmbeddedWebviewController :
MSIDWebviewUIController <MSIDWebviewInteracting, WKNavigationDelegate>
MSIDWebviewUIController <MSIDWebviewInteracting, WKNavigationDelegate, WKUIDelegate>

typedef NSURLRequest *(^MSIDExternalDecidePolicyForBrowserActionBlock)(MSIDOAuth2EmbeddedWebviewController *webView, NSURL *url);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ -(void)dealloc
{
[self.webView setNavigationDelegate:nil];
}
if ([self.webView.UIDelegate isEqual:self])
{
[self.webView setUIDelegate:nil];
}

self.webView = nil;
}
Expand Down Expand Up @@ -175,6 +179,7 @@ - (BOOL)loadView:(NSError *__autoreleasing*)error
BOOL result = [super loadView:error];

self.webView.navigationDelegate = self;
self.webView.UIDelegate = self;

#if !EXCLUDE_FROM_MSALCPP
#if DEBUG
Expand Down Expand Up @@ -479,6 +484,22 @@ - (void)webView:(WKWebView *)webView didReceiveServerRedirectForProvisionalNavig
}
}

- (void) webView:(WKWebView *)webView
requestMediaCapturePermissionForOrigin:(WKSecurityOrigin *)origin
initiatedByFrame:(WKFrameInfo *)frame
type:(WKMediaCaptureType)type
decisionHandler:(void (^)(WKPermissionDecision decision))decisionHandler API_AVAILABLE(ios(15.0), macos(12.0))
{
if (MSID_SUPPRESS_CAMERA_CONSENT_PROMPT_IN_WEBVIEW && type == WKMediaCaptureTypeCamera)
{
decisionHandler(WKPermissionDecisionGrant);
}
else
{
decisionHandler(WKPermissionDecisionPrompt);
}
}

#pragma mark - Loading Indicator

- (void)onStartLoadingIndicator:(__unused id)sender
Expand Down
4 changes: 4 additions & 0 deletions IdentityCore/tests/MSIDAADRequestErrorHandlerTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@ - (void)testHandleError_whenItIsNotServerError_shouldReturnStatusCodeAndHeaders

XCTAssertEqualObjects(returnError.domain, MSIDHttpErrorCodeDomain);
XCTAssertEqual(returnError.code, MSIDErrorServerUnhandledResponse);
NSError *underlyingError = returnError.userInfo[NSUnderlyingErrorKey];
XCTAssertEqual(underlyingError.code, MSIDErrorUnexpectedHttpResponse);
XCTAssertEqualObjects(returnError.userInfo[MSIDHTTPHeadersKey], @{@"headerKey":@"headerValue"});

XCTAssertNil(errorResponse);
Expand Down Expand Up @@ -275,6 +277,8 @@ - (void)testHandleError_whenItIsServerError_shouldReturnResponseCodeInError

XCTAssertEqualObjects(returnError.domain, MSIDHttpErrorCodeDomain);
XCTAssertEqual(returnError.code, MSIDErrorServerUnhandledResponse);
NSError *underlyingError = returnError.userInfo[NSUnderlyingErrorKey];
XCTAssertEqual(underlyingError.code, MSIDErrorUnexpectedHttpResponse);
XCTAssertEqualObjects(returnError.userInfo[MSIDHTTPResponseCodeKey], @"404");
}

Expand Down
11 changes: 11 additions & 0 deletions IdentityCore/tests/MSIDMaskedUsernameLogParameterTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,15 @@ - (void)testDescription_whenPIINotEnabled_andEmailParameterWithNoDomain_andSpace
XCTAssertEqualObjects(description, @"auth.placeholder-9f86d081__ ");
}

- (void)testDescription_whenPIINotEnabled_andEmailParameterWithDomain_shouldReturnSameMaskedValueForDifferentCase
{
[MSIDLogger sharedLogger].logMaskingLevel = MSIDLogMaskingSettingsMaskAllPII;
MSIDMaskedUsernameLogParameter *logParameter = [[MSIDMaskedUsernameLogParameter alloc] initWithParameterValue:@"username@domain.com"];
MSIDMaskedUsernameLogParameter *logParameter1 = [[MSIDMaskedUsernameLogParameter alloc] initWithParameterValue:@"UserNamE@domAIN.com"];
NSString *description = [logParameter description];
NSString *description1 = [logParameter1 description];
XCTAssertEqualObjects(description, @"auth.placeholder-16f78a7d__domain.com");
XCTAssertEqualObjects(description, description1);
}

@end
8 changes: 7 additions & 1 deletion IdentityCore/tests/MSIDTokenResponseTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,13 @@ - (void)testJsonDictionary_whenAllPropertiesSetForSuccessResponse_shouldReturnJs
XCTAssertEqualObjects(json[@"client_app_version"], @"1.0");
XCTAssertEqualObjects(json[@"expires_in"], @"300");
XCTAssertEqualObjects(json[@"expires_on"], @"1575635662");
XCTAssertEqualObjects(json[@"id_token"], @"eyJhbGciOiJSUzI1NiIsImtpZCI6Il9raWRfdmFsdWUiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJpc3N1ZXIiLCJuYW1lIjoiVGVzdCBuYW1lIiwicHJlZmVycmVkX3VzZXJuYW1lIjoidXNlckBjb250b3NvLmNvbSIsInN1YiI6InN1YiJ9.eyJhbGciOiJSUzI1NiIsImtpZCI6Il9raWRfdmFsdWUiLCJ0eXAiOiJKV1QifQ");

NSArray *idTokenComponents = [json[@"id_token"] componentsSeparatedByString:@"."];
XCTAssertEqual(idTokenComponents.count, 3);
XCTAssertEqualObjects(idTokenComponents[0], @"eyJhbGciOiJSUzI1NiIsImtpZCI6Il9raWRfdmFsdWUiLCJ0eXAiOiJKV1QifQ");
XCTAssertEqualObjects(idTokenComponents[1], @"eyJpc3MiOiJpc3N1ZXIiLCJuYW1lIjoiVGVzdCBuYW1lIiwicHJlZmVycmVkX3VzZXJuYW1lIjoidXNlckBjb250b3NvLmNvbSIsInN1YiI6InN1YiJ9");
XCTAssertEqualObjects(idTokenComponents[2], @"eyJhbGciOiJSUzI1NiIsImtpZCI6Il9raWRfdmFsdWUiLCJ0eXAiOiJKV1QifQ");

XCTAssertEqualObjects(json[@"provider_type"], @"provider_aad_v2");
XCTAssertEqualObjects(json[@"scope"], @"scope 1");
XCTAssertEqualObjects(json[@"token_type"], @"Bearer");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ typedef NS_ENUM(NSUInteger, MSIDAutomationWPJRegistrationAPIMode)
MSIDAutomationWPJRegistrationAPIModeCompanyPortal = 2 //Company Portal
};

typedef NS_ENUM(NSInteger, MSIDAutomationWPJSSOExtensionSecureStorage)
{
MSIDAutomationWPJSSOExtensionNoValueFound = 0,
MSIDAutomationWPJSSOExtensionValueNo = 1,
MSIDAutomationWPJSSOExtensionValueYes = 2
};

@interface MSIDAutomationTestRequest : NSObject <MSIDJsonSerializable>

@property (nonatomic, strong) NSString *clientId;
Expand Down Expand Up @@ -79,12 +86,15 @@ typedef NS_ENUM(NSUInteger, MSIDAutomationWPJRegistrationAPIMode)
@property (nonatomic) BOOL corruptSessionKey;
@property (nonatomic) BOOL useSafariUserAgent;
@property (nonatomic) BOOL disableCertBasedAuth;
@property (nonatomic) BOOL isMSAAccount;

@property (nonatomic) MSIDAutomationWPJRegistrationAPIMode registrationMode;
@property (nonatomic) NSString *wpjRegistrationTenantId;
@property (nonatomic) NSString *wpjRegistrationUpn;
@property (nonatomic) BOOL operateOnPrimaryWPJ;
@property (nonatomic) BOOL useMostSecureStorageForWpj;
@property (nonatomic) BOOL isSecureEnclaveSupportedForWpj;
@property (nonatomic) MSIDAutomationWPJSSOExtensionSecureStorage ssoExtensionSecureStorageEnabled;
@property (nonatomic) BOOL shouldExpirePRT;
@property (nonatomic) BOOL isSsoSeedingCompleted;
@property (nonatomic) BOOL shouldOnlyDeleteSeedingPrt;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ - (instancetype)initWithJSONDictionary:(NSDictionary *)json
_brokerEnabled = [json[@"brokerEnabled"] boolValue];
_clientCapabilities = json[@"client_capabilities"];
_refreshToken = json[@"refresh_token"];
_isMSAAccount = [json[@"isMSAAccount"] boolValue];

#if TARGET_OS_IPHONE
NSString *webviewTypeString = json[@"webviewtype"];
Expand Down Expand Up @@ -102,6 +103,8 @@ - (instancetype)initWithJSONDictionary:(NSDictionary *)json
_wpjRegistrationUpn = json[@"wpj_registration_upn"];
_operateOnPrimaryWPJ = [json[@"wpj_operate_on_primary_reg"] boolValue];
_useMostSecureStorageForWpj = [json[@"use_most_secure_storage"] boolValue];
_isSecureEnclaveSupportedForWpj = [json[@"wpj_secure_enclave_supported"] boolValue];
_ssoExtensionSecureStorageEnabled = (MSIDAutomationWPJSSOExtensionSecureStorage)[json[@"wpj_sso_extension_secure_storage_enabled"] integerValue];
_shouldExpirePRT = [json[@"should_expire_prt"] boolValue];
_isSsoSeedingCompleted = [json[@"is_sso_seeding_completed"] boolValue];
_shouldOnlyDeleteSeedingPrt = [json[@"should_only_delete_seeding_prt"] boolValue];
Expand Down Expand Up @@ -136,6 +139,7 @@ - (NSDictionary *)jsonDictionary
json[@"corrupt_session_key"] = @(_corruptSessionKey);
json[@"use_safari_ua"] = @(_useSafariUserAgent);
json[@"disable_cert_based_auth"] = @(_disableCertBasedAuth);
json[@"isMSAAccount"] = @(_isMSAAccount);

NSString *webviewType = nil;

Expand Down Expand Up @@ -182,6 +186,8 @@ - (NSDictionary *)jsonDictionary
json[@"wpj_registration_upn"] = _wpjRegistrationUpn;
json[@"wpj_operate_on_primary_reg"] = @(_operateOnPrimaryWPJ);
json[@"use_most_secure_storage"] = @(_useMostSecureStorageForWpj);
json[@"wpj_secure_enclave_supported"] = @(_isSecureEnclaveSupportedForWpj);
json[@"wpj_sso_extension_secure_storage_enabled"] = @(_ssoExtensionSecureStorageEnabled);
json[@"should_expire_prt"] = @(_shouldExpirePRT);
json[@"is_sso_seeding_completed"] = @(_isSsoSeedingCompleted);
json[@"should_only_delete_seeding_prt"] = @(_shouldOnlyDeleteSeedingPrt);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic) NSString *homeObjectId;
@property (nonatomic) NSString *homeTenantId;
@property (nonatomic) NSString *environment;
@property (nonatomic) NSString *oneAuthAccountId;

@end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ - (NSDictionary *)jsonDictionary
json[@"home_tenant_id"] = self.homeTenantId;
json[@"environment"] = self.environment;
json[@"legacyAccountId"] = self.legacyAccountId;
json[@"oneAuthAccountId"] = self.oneAuthAccountId;
return json;
}

Expand All @@ -59,6 +60,7 @@ - (instancetype)initWithJSONDictionary:(NSDictionary *)json error:(__unused NSEr
_homeTenantId = json[@"home_tenant_id"];
_environment = json[@"environment"];
_legacyAccountId = json[@"legacyAccountId"];
_oneAuthAccountId = json[@"oneAuthAccountId"];
}

return self;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@ - (void)performActionWithParameters:(__unused NSDictionary *)parameters
modifiedSince:[NSDate dateWithTimeIntervalSince1970:0]
completionHandler:^{}];

NSHTTPCookieStorage *separatedStorage = [NSHTTPCookieStorage sharedCookieStorageForGroupContainerIdentifier:@"group.com.microsoft.azureauthenticator.sso"];

for (NSHTTPCookie *cookie in separatedStorage.cookies)
{
[separatedStorage deleteCookie:cookie];
count++;
}

MSIDAutomationTestResult *testResult = [[MSIDAutomationTestResult alloc] initWithAction:self.actionIdentifier
success:YES
additionalInfo:@{@"cleared_items_count":@(count)}];
Expand Down
Loading
Loading