Skip to content

Commit 490458a

Browse files
Olga DaltonOlga Dalton
authored andcommitted
Allow passing query parameters in signout
1 parent 074f54c commit 490458a

File tree

4 files changed

+12
-1
lines changed

4 files changed

+12
-1
lines changed

MSAL/src/MSALPublicClientApplication.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1458,6 +1458,10 @@ - (void)signoutWithAccount:(nonnull MSALAccount *)account
14581458
msidParams.platformSequence = [NSString msidUpdatePlatformSequenceParamWithSrcName:[MSIDVersion platformName]
14591459
srcVersion:[MSIDVersion sdkVersion]
14601460
sequence:nil];
1461+
1462+
// Extra parameters to be added to the /authorize endpoint.
1463+
msidParams.extraURLQueryParameters = signoutParameters.extraQueryParameters;
1464+
14611465
NSError *localError;
14621466
BOOL localRemovalResult = [self removeAccountImpl:account wipeAccount:signoutParameters.wipeAccount error:&localError];
14631467

MSAL/src/public/MSALSignoutParameters.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ NS_ASSUME_NONNULL_BEGIN
6868
*/
6969
@property (nonatomic) BOOL wipeCacheForAllAccounts;
7070

71+
/**
72+
Key-value pairs to pass to the logout endpoint. This should not be url-encoded value.
73+
*/
74+
@property (nonatomic, nullable) NSDictionary <NSString *, NSString *> *extraQueryParameters;
75+
7176
/**
7277
Initialize MSALSignoutParameters with web parameters.
7378

MSAL/test/unit/MSALPublicClientApplicationTests.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3565,6 +3565,7 @@ - (void)testSignoutWithAccount_whenNonNilAccount_andSignoutFromBrowserTrue_andBr
35653565
MSALWebviewParameters *webParams = [[MSALWebviewParameters alloc] initWithAuthPresentationViewController:[self.class sharedViewControllerStub]];
35663566
MSALSignoutParameters *parameters = [[MSALSignoutParameters alloc] initWithWebviewParameters:webParams];
35673567
parameters.signoutFromBrowser = YES;
3568+
parameters.extraQueryParameters = @{@"key1": @"value1"};
35683569
MSALGlobalConfig.brokerAvailability = MSALBrokeredAvailabilityNone;
35693570

35703571
XCTAssertEqual([application allAccounts:nil].count, 1);
@@ -3581,6 +3582,7 @@ - (void)testSignoutWithAccount_whenNonNilAccount_andSignoutFromBrowserTrue_andBr
35813582

35823583
XCTAssertEqualObjects(params.accountIdentifier.displayableId, @"[email protected]");
35833584
XCTAssertEqualObjects(params.accountIdentifier.homeAccountId, @"myuid.utid");
3585+
XCTAssertEqualObjects(params.extraURLQueryParameters[@"key1"], @"value1");
35843586

35853587
XCTAssertEqualObjects(params.authority.url.absoluteString, @"https://login.microsoftonline.com/common");
35863588
XCTAssertEqualObjects(params.clientId, UNIT_TEST_CLIENT_ID);

0 commit comments

Comments
 (0)