Benjamin Arhen
2 years ago
6 changed files with 133 additions and 11 deletions
@ -0,0 +1,25 @@ |
|||
using Biskilog_Accounting.Shared.ClientContractModels; |
|||
|
|||
namespace Biskilog_Accounting.Shared.Interfaces |
|||
{ |
|||
public interface IAuthService |
|||
{ |
|||
/// <summary>
|
|||
/// Prepares and returns the connection string for a client using the specified database id
|
|||
/// </summary>
|
|||
/// <param name="a_databaseId">Specified database id to use</param>
|
|||
/// <returns></returns>
|
|||
string GetClientConnectionString(int a_databaseId); |
|||
/// <summary>
|
|||
/// Authenticates user or client
|
|||
/// </summary>
|
|||
/// <param name="a_username"></param>
|
|||
/// <param name="a_password"></param>
|
|||
/// <returns>A tokenized string with relevant information on the authenticated user</returns>
|
|||
Task<string> AuthenticateClient(string a_username, string a_password); |
|||
Contract GetContract(int a_clientId, int a_businessId); |
|||
Databasemap GetClientDB(int a_clientId); |
|||
Siteaccesspermission GetSiteaccesspermission(int a_clientId); |
|||
Clientbusiness GetClientbusiness(int a_clientId); |
|||
} |
|||
} |
@ -0,0 +1,15 @@ |
|||
using Biskilog_Accounting.Shared.ClientContractModels; |
|||
|
|||
|
|||
namespace Biskilog_Accounting.Shared.Interfaces |
|||
{ |
|||
public interface ITokenService |
|||
{ |
|||
bool ValidateToken(string a_token); |
|||
string GenerateToken(Userauth a_user, Contract a_clientContract, Databasemap a_database, Siteaccesspermission a_accessPermission); |
|||
int? GetRoleFromToken(string a_token); |
|||
int? GetUserIdFromToken(string a_token); |
|||
string? GetUserNameFromToken(string a_token); |
|||
|
|||
} |
|||
} |
Loading…
Reference in new issue