forked from ddrilling/AsbCloudServer
55 lines
1.8 KiB
C#
55 lines
1.8 KiB
C#
using AsbCloudApp.Data.User;
|
|
using System.Security.Claims;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace AsbCloudApp.Services
|
|
{
|
|
/// <summary>
|
|
/// Сервис авторизации
|
|
/// </summary>
|
|
public interface IAuthService
|
|
{
|
|
/// <summary>
|
|
/// Смена пароля пользователю
|
|
/// </summary>
|
|
/// <param name="idUser"></param>
|
|
/// <param name="newPassword"></param>
|
|
/// <returns></returns>
|
|
void ChangePassword(int idUser, string newPassword);
|
|
|
|
/// <summary>
|
|
/// Смена пароля пользователю
|
|
/// </summary>
|
|
/// <param name="userLogin"></param>
|
|
/// <param name="newPassword"></param>
|
|
/// <returns></returns>
|
|
void ChangePassword(string userLogin, string newPassword);
|
|
|
|
/// <summary>
|
|
/// Авторизация
|
|
/// </summary>
|
|
/// <param name="login"></param>
|
|
/// <param name="password"></param>
|
|
/// <param name="token">токен отмены задачи</param>
|
|
/// <returns></returns>
|
|
Task<UserTokenDto?> LoginAsync(string login,
|
|
string password, CancellationToken token = default);
|
|
|
|
/// <summary>
|
|
/// Обновление токена авторизации
|
|
/// </summary>
|
|
/// <param name="identity"></param>
|
|
/// <param name="token"></param>
|
|
/// <returns></returns>
|
|
Task<UserTokenDto?> RefreshAsync(ClaimsPrincipal identity,
|
|
CancellationToken token);
|
|
|
|
/// <summary>
|
|
/// Регистрация нового пользователя
|
|
/// </summary>
|
|
/// <param name="userDto"></param>
|
|
/// <returns></returns>
|
|
void Register(UserRegistrationDto userDto);
|
|
}
|
|
} |