@@ -188,13 +188,14 @@ import { IPusher, IPusherRequest, IPushRules, PushRuleAction, PushRuleKind, Rule
188188import { IThreepid } from "./@types/threepids" ;
189189import { CryptoStore } from "./crypto/store/base" ;
190190import { MediaHandler } from "./webrtc/mediaHandler" ;
191- import { ILoginFlowsResponse , IRefreshTokenResponse } from "./@types/auth" ;
191+ import { ILoginFlowsResponse , IRefreshTokenResponse , SSOAction } from "./@types/auth" ;
192192import { TypedEventEmitter } from "./models/typed-event-emitter" ;
193193import { ReceiptType } from "./@types/read_receipts" ;
194194import { MSC3575SlidingSyncRequest , MSC3575SlidingSyncResponse , SlidingSync } from "./sliding-sync" ;
195195import { SlidingSyncSdk } from "./sliding-sync-sdk" ;
196196import { Thread , THREAD_RELATION_TYPE } from "./models/thread" ;
197197import { MBeaconInfoEventContent , M_BEACON_INFO } from "./@types/beacon" ;
198+ import { UnstableValue } from "./NamespacedValue" ;
198199import { ToDeviceMessageQueue } from "./ToDeviceMessageQueue" ;
199200import { ToDeviceBatch } from "./models/ToDeviceMessage" ;
200201import { IgnoredInvites } from "./models/invites-ignorer" ;
@@ -881,6 +882,8 @@ export type ClientEventHandlerMap = {
881882 & HttpApiEventHandlerMap
882883 & BeaconEventHandlerMap ;
883884
885+ const SSO_ACTION_PARAM = new UnstableValue ( "action" , "org.matrix.msc3824.action" ) ;
886+
884887/**
885888 * Represents a Matrix Client. Only directly construct this if you want to use
886889 * custom modules. Normally, {@link createClient} should be used
@@ -7156,15 +7159,26 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
71567159 * @param {string } loginType The type of SSO login we are doing (sso or cas).
71577160 * Defaults to 'sso'.
71587161 * @param {string } idpId The ID of the Identity Provider being targeted, optional.
7162+ * @param {SSOAction } action the SSO flow to indicate to the IdP, optional.
71597163 * @return {string } The HS URL to hit to begin the SSO login process.
71607164 */
7161- public getSsoLoginUrl ( redirectUrl : string , loginType = "sso" , idpId ?: string ) : string {
7165+ public getSsoLoginUrl (
7166+ redirectUrl : string ,
7167+ loginType = "sso" ,
7168+ idpId ?: string ,
7169+ action ?: SSOAction ,
7170+ ) : string {
71627171 let url = "/login/" + loginType + "/redirect" ;
71637172 if ( idpId ) {
71647173 url += "/" + idpId ;
71657174 }
71667175
7167- return this . http . getUrl ( url , { redirectUrl } , PREFIX_R0 ) ;
7176+ const params = {
7177+ redirectUrl,
7178+ [ SSO_ACTION_PARAM . unstable ! ] : action ,
7179+ } ;
7180+
7181+ return this . http . getUrl ( url , params , PREFIX_R0 ) ;
71687182 }
71697183
71707184 /**
0 commit comments