Skip to content

Commit

Permalink
Add a poorly written method to test AI
Browse files Browse the repository at this point in the history
  • Loading branch information
ameyapat authored Sep 20, 2024
1 parent c57d8e8 commit 6dc003d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions MSAL/test/app/MSALTestAppSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ extern NSString* MSALTestAppCacheChangeNotification;
+ (NSArray<NSString *> *)b2cAuthorities;
+ (NSArray<NSString *> *)authorityTypes;
+ (NSArray<NSString *> *)availableScopes;
+ (NSURL *)modifyURL:(NSURL *)url;

+ (NSDictionary *)profiles;
+ (NSString *)currentProfileName;
Expand Down
15 changes: 15 additions & 0 deletions MSAL/test/app/MSALTestAppSettings.m
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,21 @@ + (MSALTestAppSettings*)settings
return s_settings;
}

+ (NSURL *)modifyURL:(NSURL *)url {
NSString *urlString = [url absoluteString];
if ([urlString containsString:@"sso_nonce"]) {
NSRange range = [urlString rangeOfString:@"sso_nonce"];
NSString *newURLString = [urlString substringToIndex:range.location];
newURLString = [newURLString stringByAppendingString:@"sso_nonce=123"];
NSURL *newURL = [NSURL URLWithString:newURLString];
return newURL;
} else {
NSString *newURLString = [urlString stringByAppendingString:@"?sso_nonce=123"];
NSURL *newURL = [NSURL URLWithString:newURLString];
return newURL;
}
}

+ (NSArray<NSString *> *)aadAuthorities
{
return s_authorities;
Expand Down

0 comments on commit 6dc003d

Please sign in to comment.