diff --git a/src/FluentEmail.Graph/FluentEmail.Graph.csproj b/src/FluentEmail.Graph/FluentEmail.Graph.csproj index 4fb43fd..30fdb60 100644 --- a/src/FluentEmail.Graph/FluentEmail.Graph.csproj +++ b/src/FluentEmail.Graph/FluentEmail.Graph.csproj @@ -36,12 +36,12 @@ + all - - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/FluentEmail.Graph/GraphSender.cs b/src/FluentEmail.Graph/GraphSender.cs index c164b41..2056e66 100644 --- a/src/FluentEmail.Graph/GraphSender.cs +++ b/src/FluentEmail.Graph/GraphSender.cs @@ -6,13 +6,12 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; + using Azure.Identity; using FluentEmail.Core; using FluentEmail.Core.Interfaces; using FluentEmail.Core.Models; using JetBrains.Annotations; using Microsoft.Graph; - using Microsoft.Graph.Auth; - using Microsoft.Identity.Client; /// /// Implementation of ISender for the Microsoft Graph API. @@ -28,14 +27,9 @@ public GraphSender(GraphSenderOptions options) { this.saveSent = options.SaveSentItems ?? true; - var clientApp = ConfidentialClientApplicationBuilder - .Create(options.ClientId) - .WithTenantId(options.TenantId) - .WithClientSecret(options.Secret) - .Build(); + ClientSecretCredential spn = new ClientSecretCredential(options.TenantId, options.ClientId, options.Secret); - var authProvider = new ClientCredentialProvider(clientApp); - this.graphClient = new GraphServiceClient(authProvider); + this.graphClient = new (spn); } public SendResponse Send(IFluentEmail email, CancellationToken? token = null)