You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[C#] feat: Implement GetTokenOrStartSignInAsync method public interface (#987)
## Linked issues
closes: #894 (issue number)
## Details
- Rename `TeamsAIAuthException` to `AuthException`
- Rename `TeamsAIAuthReason` to `AuthExceptionReason`
- Implement helper methods in `AuthUtilities`
- Implement `GetTokenOrStartSignInAsync`.
- Add `IsUserSignedIn` to `IAuthentication` interface - this is needed
so it can be called in the `Application` class.
- Make `AuthenticationManager._default` private property public
`Default`.
## Attestation Checklist
- [x] My code follows the style guidelines of this project
- I have checked for/fixed spelling, linting, and other errors
- I have commented my code for clarity
- I have made corresponding changes to the documentation (we use
[TypeDoc](https://typedoc.org/) to document our code)
- My changes generate no new warnings
- I have added tests that validates my changes, and provides sufficient
test coverage. I have tested with:
- Local testing
- E2E testing in Teams
- New and existing unit tests pass locally with my changes
Copy file name to clipboardExpand all lines: dotnet/packages/Microsoft.TeamsAI/Microsoft.TeamsAI.Tests/Application/Authentication/Bot/BotAuthenticationBaseTests.cs
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@ public override Task<DialogTurnResult> ContinueDialog(ITurnContext context, TSta
25
25
{
26
26
if(_throwExceptionWhenContinue)
27
27
{
28
-
thrownewTeamsAIAuthException("mocked error");
28
+
thrownewAuthException("mocked error");
29
29
}
30
30
returnTask.FromResult(_continueDialogResult);
31
31
}
@@ -161,7 +161,7 @@ public async void Test_HandleSignInActivity_Complete()
161
161
messageText=context.Activity.Text;
162
162
returnTask.CompletedTask;
163
163
});
164
-
botAuth.OnUserSignInFailure((context,state,exception)=>{thrownewTeamsAIAuthException("sign in failure handler should not be called");});
164
+
botAuth.OnUserSignInFailure((context,state,exception)=>{thrownewAuthException("sign in failure handler should not be called");});
Copy file name to clipboardExpand all lines: dotnet/packages/Microsoft.TeamsAI/Microsoft.TeamsAI.Tests/Application/Authentication/MessageExtensions/MessageExtensionsAuthenticationBaseTests.cs
Copy file name to clipboardExpand all lines: dotnet/packages/Microsoft.TeamsAI/Microsoft.TeamsAI.Tests/Application/Authentication/MockedAuthentication.cs
0 commit comments