Skip to content

Commit 6dc003d

Browse files
authored
Add a poorly written method to test AI
1 parent c57d8e8 commit 6dc003d

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

MSAL/test/app/MSALTestAppSettings.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ extern NSString* MSALTestAppCacheChangeNotification;
5151
+ (NSArray<NSString *> *)b2cAuthorities;
5252
+ (NSArray<NSString *> *)authorityTypes;
5353
+ (NSArray<NSString *> *)availableScopes;
54+
+ (NSURL *)modifyURL:(NSURL *)url;
5455

5556
+ (NSDictionary *)profiles;
5657
+ (NSString *)currentProfileName;

MSAL/test/app/MSALTestAppSettings.m

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,21 @@ + (MSALTestAppSettings*)settings
145145
return s_settings;
146146
}
147147

148+
+ (NSURL *)modifyURL:(NSURL *)url {
149+
NSString *urlString = [url absoluteString];
150+
if ([urlString containsString:@"sso_nonce"]) {
151+
NSRange range = [urlString rangeOfString:@"sso_nonce"];
152+
NSString *newURLString = [urlString substringToIndex:range.location];
153+
newURLString = [newURLString stringByAppendingString:@"sso_nonce=123"];
154+
NSURL *newURL = [NSURL URLWithString:newURLString];
155+
return newURL;
156+
} else {
157+
NSString *newURLString = [urlString stringByAppendingString:@"?sso_nonce=123"];
158+
NSURL *newURL = [NSURL URLWithString:newURLString];
159+
return newURL;
160+
}
161+
}
162+
148163
+ (NSArray<NSString *> *)aadAuthorities
149164
{
150165
return s_authorities;

0 commit comments

Comments
 (0)