Skip to content
9 changes: 7 additions & 2 deletions libraries/botbuilder/src/botFrameworkAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<void> {
public async signOutUser(context: TurnContext, connectionName?: string, userId?: string): Promise<void> {
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 } );
Expand Down