Skip to content
Merged
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
4 changes: 2 additions & 2 deletions src/FluentEmail.Graph/FluentEmail.Graph.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Azure.Identity" Version="1.5.0" />
<PackageReference Include="FluentEmail.Core" Version="3.0.0" />
<PackageReference Include="JetBrains.Annotations" Version="2021.2.0">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.Graph" Version="3.32.0" />
<PackageReference Include="Microsoft.Graph.Auth" Version="1.0.0-preview.6" />
<PackageReference Include="Microsoft.Graph" Version="4.7.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
Expand Down
12 changes: 3 additions & 9 deletions src/FluentEmail.Graph/GraphSender.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/// <summary>
/// Implementation of <c>ISender</c> for the Microsoft Graph API.
Expand All @@ -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)
Expand Down