Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Fix element-desktop-ssoid being included in OIDC Authorization call #12495

Merged
merged 5 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
5 changes: 3 additions & 2 deletions src/BasePlatform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,10 @@ export default abstract class BasePlatform {

/**
* The URL to return to after a successful SSO/OIDC authentication
* @param forOidc whether the callback URL is for OIDC or legacy SSO
* @param fragmentAfterLogin optional fragment for specific view to return to
*/
public getSSOCallbackUrl(fragmentAfterLogin = ""): URL {
public getSSOCallbackUrl(forOidc = false, fragmentAfterLogin = ""): URL {
const url = new URL(window.location.href);
url.hash = fragmentAfterLogin;
return url;
Expand Down Expand Up @@ -346,7 +347,7 @@ export default abstract class BasePlatform {
if (idpId) {
localStorage.setItem(SSO_IDP_ID_KEY, idpId);
}
const callbackUrl = this.getSSOCallbackUrl(fragmentAfterLogin);
const callbackUrl = this.getSSOCallbackUrl(false, fragmentAfterLogin);
window.location.href = mxClient.getSsoLoginUrl(callbackUrl.toString(), loginType, idpId, action); // redirect to SSO
}

Expand Down
2 changes: 1 addition & 1 deletion src/utils/oidc/authorize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const startOidcLogin = async (
identityServerUrl?: string,
isRegistration?: boolean,
): Promise<void> => {
const redirectUri = PlatformPeg.get()!.getSSOCallbackUrl().href;
const redirectUri = PlatformPeg.get()!.getSSOCallbackUrl(true).href;

const nonce = randomString(10);

Expand Down
Loading