diff --git a/libraries/botbuilder/src/botFrameworkAdapter.ts b/libraries/botbuilder/src/botFrameworkAdapter.ts index e61c8a1e07..b9d107cea7 100644 --- a/libraries/botbuilder/src/botFrameworkAdapter.ts +++ b/libraries/botbuilder/src/botFrameworkAdapter.ts @@ -402,13 +402,18 @@ export class BotFrameworkAdapter extends BotAdapter implements IUserTokenProvide * Signs the user out with the token server. * @param context Context for the current turn of conversation with the user. * @param connectionName Name of the auth connection to use. + * @param userId id of user to sign out. + * @returns A promise that represents the work queued to execute. */ - public async signOutUser(context: TurnContext, connectionName: string): Promise { + public async signOutUser(context: TurnContext, connectionName?: string, userId?: string): Promise { if (!context.activity.from || !context.activity.from.id) { throw new Error(`BotFrameworkAdapter.signOutUser(): missing from or from.id`); } + if (!userId){ + userId = context.activity.from.id; + } + this.checkEmulatingOAuthCards(context); - const userId: string = context.activity.from.id; const url: string = this.oauthApiUrl(context); const client: TokenApiClient = this.createTokenApiClient(url); await client.userToken.signOut(userId, { connectionName: connectionName, channelId: context.activity.channelId } );