mirror of
https://github.com/bitwarden/server
synced 2025-12-06 00:03:34 +00:00
* Add Microsoft Teams integration * Fix method naming error * Expand and clean up unit test coverage * Update with PR feedback * Add documentation, add In Progress logic/tests for Teams * Fixed lowercase Slack * Added docs; Updated PR suggestions; * Fix broken tests
29 lines
821 B
C#
29 lines
821 B
C#
using Microsoft.Bot.Connector.Authentication;
|
|
|
|
namespace Bit.Core.AdminConsole.Models.Teams;
|
|
|
|
public class TeamsBotCredentialProvider(string clientId, string clientSecret) : ICredentialProvider
|
|
{
|
|
private const string _microsoftBotFrameworkIssuer = AuthenticationConstants.ToBotFromChannelTokenIssuer;
|
|
|
|
public Task<bool> IsValidAppIdAsync(string appId)
|
|
{
|
|
return Task.FromResult(appId == clientId);
|
|
}
|
|
|
|
public Task<string?> GetAppPasswordAsync(string appId)
|
|
{
|
|
return Task.FromResult(appId == clientId ? clientSecret : null);
|
|
}
|
|
|
|
public Task<bool> IsAuthenticationDisabledAsync()
|
|
{
|
|
return Task.FromResult(false);
|
|
}
|
|
|
|
public Task<bool> ValidateIssuerAsync(string issuer)
|
|
{
|
|
return Task.FromResult(issuer == _microsoftBotFrameworkIssuer);
|
|
}
|
|
}
|