2019-02-16 16:04:40 -05:00
|
|
|
|
using SharedLibraryCore.Helpers;
|
|
|
|
|
using System;
|
2019-02-15 23:19:59 -05:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
|
|
namespace SharedLibraryCore.Interfaces
|
|
|
|
|
{
|
|
|
|
|
public interface ITokenAuthentication
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// generates and returns a token for the given network id
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="networkId">network id of the players to generate the token for</param>
|
|
|
|
|
/// <returns>4 character string token</returns>
|
2019-02-16 16:04:40 -05:00
|
|
|
|
TokenState GenerateNextToken(long networkId);
|
2019-02-15 23:19:59 -05:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// authorizes given token
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="token">token to authorize</param>
|
|
|
|
|
/// <returns>true if token authorized successfully, false otherwise</returns>
|
|
|
|
|
bool AuthorizeToken(long networkId, string token);
|
|
|
|
|
}
|
|
|
|
|
}
|