2022-09-17 22:13:35 +03:00
|
|
|
using System;
|
|
|
|
using System.Security.Claims;
|
2022-09-10 00:33:17 +03:00
|
|
|
using System.Threading.Tasks;
|
2022-09-17 22:13:35 +03:00
|
|
|
using BlueWest.Data.Application;
|
2022-09-10 00:33:17 +03:00
|
|
|
using Microsoft.AspNetCore.Identity;
|
|
|
|
|
|
|
|
namespace BlueWest.WebApi.Context.Users;
|
|
|
|
|
2022-09-10 07:12:03 +03:00
|
|
|
/// <summary>
|
|
|
|
/// Auth manager contract interface.
|
|
|
|
/// </summary>
|
2022-09-10 00:33:17 +03:00
|
|
|
public interface IAuthManager
|
|
|
|
{
|
2022-09-10 07:12:03 +03:00
|
|
|
/// <summary>
|
|
|
|
/// CreateUserAsync
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="registerViewModel"></param>
|
|
|
|
/// <returns></returns>
|
2022-09-10 00:33:17 +03:00
|
|
|
Task<IdentityResult> CreateUserAsync(RegisterViewModel registerViewModel);
|
2022-09-18 04:00:24 +03:00
|
|
|
|
2022-09-10 07:12:03 +03:00
|
|
|
/// <summary>
|
2022-09-18 04:00:24 +03:00
|
|
|
/// Does Login
|
2022-09-10 07:12:03 +03:00
|
|
|
/// </summary>
|
2022-09-17 22:13:35 +03:00
|
|
|
/// <param name="loginRequest"></param>
|
2022-09-10 07:12:03 +03:00
|
|
|
/// <returns></returns>
|
2022-09-18 04:00:24 +03:00
|
|
|
public Task<(bool, string, ClaimsIdentity)> GetSessionTokenId(LoginRequest loginRequest);
|
2022-09-17 22:13:35 +03:00
|
|
|
|
|
|
|
/// <summary>
|
2022-09-18 04:00:24 +03:00
|
|
|
/// Gets a valid bearer token by the session id
|
2022-09-17 22:13:35 +03:00
|
|
|
/// </summary>
|
2022-09-18 04:00:24 +03:00
|
|
|
/// <param name="sessionId"></param>
|
2022-09-17 22:13:35 +03:00
|
|
|
/// <returns></returns>
|
2022-09-18 04:00:24 +03:00
|
|
|
Task<(bool, string)> GetBearerTokenBySessionTokenId(string sessionId);
|
2022-09-10 00:33:17 +03:00
|
|
|
|
|
|
|
}
|