Skip to content

Commit

Permalink
Merge pull request #1005 from OfficeDev/v-mfurquan/app-sso-get-tokenr…
Browse files Browse the repository at this point in the history
…esponse-updates

Updated GetTokenResponse In missing file
  • Loading branch information
Pawank-MSFT authored Oct 27, 2023
2 parents b0edf72 + 926e3f1 commit 42db6e4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,8 @@ private async Task<TokenResponse> GetTokenResponse(ITurnContext<IInvokeActivity>
magicCode = parsed.ToString();
}
}
var tokenResponse = await (turnContext.Adapter as IUserTokenProvider).GetUserTokenAsync(turnContext, _connectionName, magicCode, cancellationToken: cancellationToken);
var userTokenClient = turnContext.TurnState.Get<UserTokenClient>();
var tokenResponse = await userTokenClient.GetUserTokenAsync(turnContext.Activity.From.Id, _connectionName, turnContext.Activity.ChannelId, magicCode, cancellationToken).ConfigureAwait(false);
return tokenResponse;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,18 @@
using Microsoft.Bot.Schema;
using Microsoft.Extensions.Logging;
using Microsoft.Bot.Connector.Authentication;
using Microsoft.Extensions.Configuration;
using Microsoft.Bot.Builder.Teams;

namespace Microsoft.BotBuilderSamples
{
public class AdapterWithErrorHandler : CloudAdapter
{
public AdapterWithErrorHandler(BotFrameworkAuthentication auth, ILogger<IBotFrameworkHttpAdapter> logger, ConversationState conversationState = default)
public AdapterWithErrorHandler(IConfiguration configuration, IStorage storage, BotFrameworkAuthentication auth, ILogger<IBotFrameworkHttpAdapter> logger, ConversationState conversationState = default)
: base(auth, logger)
{
base.Use(new TeamsSSOTokenExchangeMiddleware(storage, configuration["ConnectionName"]));

OnTurnError = async (turnContext, exception) =>
{
// Log any leaked exception from the application.
Expand Down

0 comments on commit 42db6e4

Please sign in to comment.