Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion samples/dotnet/GenesysHandoff/GenesysHandoffAgent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public GenesysHandoffAgent(AgentApplicationOptions options, IHttpClientFactory h
_genesysService = genesysService;
OnMessage("-reset", HandleResetMessage);
OnMessage("-signout", HandleSignOut);
OnActivity((turnContext, cancellationToken) => Task.FromResult(true), HandleAllActivities, autoSignInHandlers: ["mcs"]);
OnActivity((turnContext, cancellationToken) => Task.FromResult(true), HandleAllActivities);
UserAuthorization.OnUserSignInFailure(async (turnContext, turnState, handlerName, response, initiatingActivity, cancellationToken) =>
{
await turnContext.SendActivityAsync($"SignIn failed with '{handlerName}': {response.Cause}/{response.Error!.Message}", cancellationToken: cancellationToken);
Expand Down
8 changes: 4 additions & 4 deletions samples/dotnet/GenesysHandoff/appManifest/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
"outline": "outline.png"
},
"name": {
"short": "User Authorization (OAuth+OBO)",
"full": "User Authorization (OAuth+OBO)"
"short": "GenesysHandoffAgent",
"full": "GenesysHandoffAgent"
},
"description": {
"short": "Sample demonstrating Azure Bot Services user authorization with using a Agent.",
"full": "This sample demonstrates how to integrate with Microsoft Copilot Studio using OBO and CopilotStudioClient."
"short": "Genesys Handoff",
"full": "Integrating Genesys Handoff functionality within a Microsoft Copilot Studio agent."
},
"accentColor": "#FFFFFF",
"copilotAgents": {
Expand Down
2 changes: 1 addition & 1 deletion samples/dotnet/GenesysHandoff/appsettings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"TokenValidation": {
"Enabled": true,
"Enabled": false,
"Audiences": [
"{{ClientID}}"
],
Expand Down
6 changes: 2 additions & 4 deletions samples/dotnet/obo-authorization/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,9 @@ CopilotClient GetClient(AgentApplication app, ITurnContext turnContext)

// Since Auto SignIn is enabled, by the time this is called the token is already available via UserAuthorization.GetTurnTokenAsync or
// UserAuthorization.ExchangeTurnTokenAsync.
// NOTE: This is a slightly unusual way to handle incoming Activities (but perfectly) valid. For this sample,
// we just want to proxy messages to/from a Copilot Studio Agent.
// For this sample we just want to proxy messages to a Copilot Studio Agent.
app.OnActivity((turnContext, cancellationToken) => Task.FromResult(true), async (turnContext, turnState, cancellationToken) =>
{

var mcsConversationId = turnState.Conversation.GetValue<string>(MCSConversationPropertyName);
var cpsClient = GetClient(app, turnContext);

Expand Down Expand Up @@ -100,7 +98,7 @@ CopilotClient GetClient(AgentApplication app, ITurnContext turnContext)
}
}
}
}, autoSignInHandlers: ["mcs"]);
});

// Called when the OAuth flow fails
app.UserAuthorization.OnUserSignInFailure(async (turnContext, turnState, handlerName, response, initiatingActivity, cancellationToken) =>
Expand Down
1 change: 1 addition & 0 deletions samples/dotnet/obo-authorization/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

"UserAuthorization": {
"AutoSignIn": true,
"DefaultHandlerName": "mcs",
"Handlers": {
"mcs": {
"Settings": {
Expand Down