Files
SharepointToolbox-Web/Services/ISessionManager.cs
T
2026-06-02 10:56:03 +02:00

15 lines
625 B
C#

using Microsoft.SharePoint.Client;
using SharepointToolbox.Web.Core.Models;
namespace SharepointToolbox.Web.Services;
public interface ISessionManager
{
Task<ClientContext> GetOrCreateContextAsync(TenantProfile profile, CancellationToken ct = default);
Task<ClientContext> GetOrCreateContextAsync(string siteUrl, TenantProfile profile, CancellationToken ct = default);
Task<(string Token, DateTimeOffset ExpiresAt)> GetAccessTokenWithExpiryAsync(string scope, CancellationToken ct = default);
Task ClearSessionAsync(string tenantUrl);
Task ClearAllAsync();
bool IsAuthenticated(string tenantUrl);
}