using System.Security.Claims;
using System.Threading;
using System.Threading.Tasks;
using Kavita.Common;
using Kavita.Models.Entities.User;
using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.AspNetCore.Http;
namespace Kavita.API.Services;
public interface IOidcService
{
///
/// Returns the user authenticated with OpenID Connect
///
///
///
///
///
/// if any requirements aren't met
Task LoginOrCreate(HttpRequest request, ClaimsPrincipal principal, CancellationToken ct = default);
///
/// Refresh the token inside the cookie when it's close to expiring. And sync the user
///
///
///
///
/// If the token is refreshed successfully, updates the last active time of the suer
Task RefreshCookieToken(CookieValidatePrincipalContext ctx, CancellationToken ct = default);
///
/// Remove from all users
///
///
///
Task ClearOidcIds(CancellationToken ct = default);
}