-
Notifications
You must be signed in to change notification settings - Fork 528
Conversation
…to lamil/multi_auth
solutions/Virtual-Assistant/src/csharp/microsoft.bot.solutions/Authentication/OAuthProvider.cs
Show resolved
Hide resolved
...rtual-Assistant/src/csharp/microsoft.bot.solutions/Authentication/MultiProviderAuthDialog.cs
Outdated
Show resolved
Hide resolved
AddDialog(new WaterfallDialog(nameof(MultiProviderAuthDialog), auth)); | ||
AddDialog(new ChoicePrompt(DialogIds.ProviderPrompt) { Style = ListStyle.SuggestedAction }); | ||
|
||
foreach (var connection in skillConfiguration.AuthenticationConnections) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it possible skillConfiguration.AuthenticationConnections to be null?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added null checks in all the SkillDialogs
|
||
private async Task<DialogTurnResult> PromptForProvider(WaterfallStepContext stepContext, CancellationToken cancellationToken) | ||
{ | ||
if (_skillConfiguration.AuthenticationConnections.Count() == 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think i'd check AuthenticationConnections is null before using it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
catch | ||
{ | ||
throw; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
catch block useless if you're just gonna throw
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
//await a.SignOutUserAsync(dc.Context, skillConfiguration.AuthConnectionName, dc.Context.Activity.From.Id, default(CancellationToken)); | ||
if (!_useCachedTokens) | ||
{ | ||
var a = dc.Context.Adapter as BotFrameworkAdapter; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'a' is definitely not the worst variable name ever :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
renamed :)
@@ -17,7 +19,7 @@ public class CalendarService : ICalendar | |||
/// <param name="token">the access token.</param> | |||
/// <param name="source">the calendar provider.</param> | |||
/// <param name="timeZoneInfo">the user timezone info.</param> | |||
public CalendarService(string token, EventSource source) | |||
public CalendarService(string token, EventSource source, GoogleClient config) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's think about how to do this in a better way, in a different PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created an issue to track #244
@@ -18,6 +18,16 @@ | |||
<CodeAnalysisRuleSet>..\..\VirtualAssistant.ruleset</CodeAnalysisRuleSet> | |||
</PropertyGroup> | |||
|
|||
<ItemGroup> | |||
<None Remove="ServiceClients\WindowsIanaMapping" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this generated by changing the output policy to 'Always'? feel like it's not needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed the comments and changes, makes sense!
* consolidated skill case statements * va multi-auth handling * started skill update for multi auth * fixed indentation * updated skill authentication dialog * updated va authentication to include provider in token response * updated logout method * multi auth in skills * updated calendar skill to pull google config from appsettings * updated to use t4 template responses * consolidated skill case statements * va multi-auth handling * started skill update for multi auth * fixed indentation * updated skill authentication dialog * updated va authentication to include provider in token response * updated logout method * multi auth in skills * updated calendar skill to pull google config from appsettings * updated to use t4 template responses * updated appsettings for va * turned useCachedTokens on * Added validator for multi-auth prompts * Added todo service provider back to appsettings * change to use the oauth ConnectionName to drive buttons * stylecop fixes * reverting trivial appSettings change * review fixes * updated email skill test
Description
This change adds support for multiple authentication providers in the virtual assistant and skills.
Expected Behavior
Related Issue
fixes #19Testing Steps