private AuthToken CreateAuthTokenWithoutPasswordCheck(string path, string username, AuthToken.AuthTypes authType, int expireMiniutes = 30) { var fi = new FileInfo(path + "/" + username + ".lgn"); if (fi.Exists) { return(new AuthToken(username, authType, new DateTimeOffset(DateTime.UtcNow.Ticks, new TimeSpan(0, 30, 0)))); } return(null); }
private AuthToken CreateAuthToken(string path, string username, string password, AuthToken.AuthTypes authType, int expireMiniutes = 30) { var fi = new FileInfo(path + "/" + username + ".lgn"); if (fi.Exists) { if (SecureCrypto.VerifyPassword(password, File.ReadAllText(fi.FullName), username)) { return(new AuthToken(username, authType, new DateTimeOffset(DateTime.UtcNow.Ticks, new TimeSpan(0, 30, 0)))); } } return(null); }