Skip to content

Commit 7e9b0b6

Browse files
authored
Merge branch 'dev' into sedemche/fix_loading_indicator
2 parents ed47c1b + eba56bb commit 7e9b0b6

7 files changed

+222
-48
lines changed

IdentityCore/tests/automation/ui_tests_lib/MSIDClientCredentialHelper.m

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,17 @@ + (void)getAccessTokenForAuthority:(NSString *)authority
5454
clientCredential:(NSString *)clientCredential
5555
completionHandler:(void (^)(NSString *, NSError *))completionHandler
5656
{
57+
// Validate required parameters
58+
if (!authority || !resource || !clientId || !clientCredential)
59+
{
60+
if (completionHandler)
61+
{
62+
NSError *error = MSIDCreateError(MSIDErrorDomain, MSIDErrorInternal, @"Missing required parameters for client credential flow.", nil, nil, nil, nil, nil, YES);
63+
completionHandler(nil, error);
64+
}
65+
return;
66+
}
67+
5768
MSIDLegacyTokenCacheKey *cacheKey = [[MSIDLegacyTokenCacheKey alloc] initWithAuthority:[NSURL URLWithString:authority]
5869
clientId:clientId
5970
resource:resource
@@ -91,6 +102,17 @@ + (void)getAccessTokenForAuthority:(NSString *)authorityString
91102
certificatePassword:(NSString *)password
92103
completionHandler:(void (^)(NSString *accessToken, NSError *error))completionHandler
93104
{
105+
// Validate required parameters
106+
if (!authorityString || !resource || !clientId || !certificateData || !password)
107+
{
108+
if (completionHandler)
109+
{
110+
NSError *error = MSIDCreateError(MSIDErrorDomain, MSIDErrorInternal, @"Missing required parameters for certificate-based client credential flow.", nil, nil, nil, nil, nil, YES);
111+
completionHandler(nil, error);
112+
}
113+
return;
114+
}
115+
94116
MSIDLegacyTokenCacheKey *cacheKey = [[MSIDLegacyTokenCacheKey alloc] initWithAuthority:[NSURL URLWithString:authorityString]
95117
clientId:clientId
96118
resource:resource

IdentityCore/tests/automation/ui_tests_lib/MSIDTestConfigurationProvider.m

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ - (instancetype)initWithClientCertificateContents:(NSString *)certificate
5858
defaultScopes:(NSDictionary *)defaultScopes
5959
defaultResources:(NSDictionary *)defaultResources
6060
operationAPIConf:(NSDictionary *)operationAPIConfiguration
61+
functionAppAPIConf:(NSDictionary *)functionAppAPIConfiguration
6162
jitConfig:(NSDictionary *)jitConfig
6263
{
6364
self = [super init];
@@ -76,10 +77,10 @@ - (instancetype)initWithClientCertificateContents:(NSString *)certificate
7677
MSIDAutomationOperationAPIInMemoryCacheHandler *cacheHandler = [[MSIDAutomationOperationAPIInMemoryCacheHandler alloc] initWithDictionary:additionalConfigurations];
7778

7879
_operationAPIRequestHandler = [[MSIDAutomationOperationAPIRequestHandler alloc] initWithAPIPath:operationAPIConfiguration[@"operation_api_path"]
79-
8080
encodedCertificate:certificate
8181
certificatePassword:password
82-
operationAPIConfiguration:operationAPIConfiguration];
82+
operationAPIConfiguration:operationAPIConfiguration
83+
functionAppAPIConfiguration:functionAppAPIConfiguration];
8384
_operationAPIRequestHandler.apiCacheHandler = cacheHandler;
8485

8586
_passwordRequestHandler = [MSIDAutomationPasswordRequestHandler new];
@@ -148,6 +149,7 @@ - (instancetype)initWithConfigurationPath:(NSString *)configurationPath
148149
defaultScopes:configurationDictionary[@"scopes"]
149150
defaultResources:configurationDictionary[@"resources"]
150151
operationAPIConf:configurationDictionary[@"operation_api_conf"]
152+
functionAppAPIConf:configurationDictionary[@"function_app_api_url"]
151153
jitConfig:configurationDictionary[@"jit_intune_ids"]];
152154

153155
}

IdentityCore/tests/automation/ui_tests_lib/lab_api/MSIDAutomationDeleteDeviceAPIRequest.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ - (NSString *)requestOperationPath
3434

3535
- (NSString *)httpMethod
3636
{
37-
return @"DELETE";
37+
return @"POST";
3838
}
3939

4040
- (NSArray<NSURLQueryItem *> *)queryItems

IdentityCore/tests/automation/ui_tests_lib/lab_api/MSIDAutomationOperationAPIRequestHandler.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@
4545
- (instancetype)initWithAPIPath:(NSString *)apiPath
4646
encodedCertificate:(NSString *)encodedCertificate
4747
certificatePassword:(NSString *)certificatePassword
48-
operationAPIConfiguration:(NSDictionary *)operationAPIConfiguration;
48+
operationAPIConfiguration:(NSDictionary *)operationAPIConfiguration
49+
functionAppAPIConfiguration:(NSDictionary *)functionAppAPIConfiguration;
4950

5051
- (void)executeAPIRequest:(MSIDAutomationBaseApiRequest *)apiRequest
5152
responseHandler:(id<MSIDAutomationOperationAPIResponseHandler>)responseHandler

0 commit comments

Comments
 (0)