Fix Native OIDC for Element Desktop by including ssoid in the url_state of the /auth call

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
pull/27017/head
Michael Telatynski 2024-02-15 17:36:27 +00:00
parent c19737b387
commit aa5024adae
No known key found for this signature in database
GPG Key ID: A2B008A5F49F5D0D
1 changed files with 7 additions and 1 deletions

View File

@ -57,6 +57,8 @@ interface SquirrelUpdate {
updateURL: string;
}
const SSO_ID_KEY = "element-desktop-ssoid";
const isMac = navigator.platform.toUpperCase().includes("MAC");
function platformFriendlyName(): string {
@ -378,7 +380,7 @@ export default class ElectronPlatform extends VectorBasePlatform {
public getSSOCallbackUrl(fragmentAfterLogin: string): URL {
const url = super.getSSOCallbackUrl(fragmentAfterLogin);
url.protocol = "element";
url.searchParams.set("element-desktop-ssoid", this.ssoID);
url.searchParams.set(SSO_ID_KEY, this.ssoID);
return url;
}
@ -451,4 +453,8 @@ export default class ElectronPlatform extends VectorBasePlatform {
clientUri: "https://element.io",
};
}
public getOidcClientState(): string {
return `:${SSO_ID_KEY}:${this.ssoID}`;
}
}