DD.WellWorkover.Cloud/AsbCloudApp/Services/IAuthService.cs

53 lines
1.7 KiB
C#
Raw Normal View History

using AsbCloudApp.Data;
using System.Security.Claims;
using System.Threading;
using System.Threading.Tasks;
namespace AsbCloudApp.Services
{
2022-08-05 17:16:11 +05:00
/// <summary>
/// Сервис авторизации
/// </summary>
public interface IAuthService
{
2022-08-05 17:16:11 +05:00
/// <summary>
/// Смена пароля пользователю
/// </summary>
/// <param name="idUser"></param>
/// <param name="newPassword"></param>
/// <returns></returns>
int ChangePassword(int idUser, string newPassword);
2022-08-05 17:16:11 +05:00
/// <summary>
/// Смена пароля пользователю
/// </summary>
/// <param name="userLogin"></param>
/// <param name="newPassword"></param>
/// <returns></returns>
int ChangePassword(string userLogin, string newPassword);
2022-08-05 17:16:11 +05:00
/// <summary>
/// Авторизация
/// </summary>
/// <param name="login"></param>
/// <param name="password"></param>
/// <param name="token">токен отмены задачи</param>
/// <returns></returns>
2021-09-10 11:28:57 +05:00
Task<UserTokenDto> LoginAsync(string login,
string password, CancellationToken token = default);
2022-08-05 17:16:11 +05:00
/// <summary>
/// Обновление токена авторизации
/// </summary>
/// <param name="user"></param>
/// <returns></returns>
string Refresh(ClaimsPrincipal user);
2022-08-05 17:16:11 +05:00
/// <summary>
/// Регистрация нового пользователя
/// </summary>
/// <param name="userDto"></param>
/// <returns></returns>
int Register(UserRegistrationDto userDto);
}
}