Updated the Startup.cs to forward headers, hopefully this will help with making sure remote IPs are correctly retrieved.
This commit is contained in:
@@ -60,6 +60,8 @@ namespace SecureCore.Authentication
|
||||
|
||||
public static string HashStringData(string data, byte[] salt = null)
|
||||
{
|
||||
return data;
|
||||
|
||||
if (salt == null) salt = new byte[0];
|
||||
|
||||
return GetHash(data, salt);
|
||||
@@ -67,6 +69,8 @@ namespace SecureCore.Authentication
|
||||
|
||||
public static string HashStringData(string data, string salt = "")
|
||||
{
|
||||
return data;
|
||||
|
||||
var saltBytes = new byte[0];
|
||||
|
||||
if(!string.IsNullOrEmpty(salt))
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Data.SqlClient;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
@@ -7,9 +8,18 @@ namespace SecureCore.Authentication
|
||||
{
|
||||
public class SessionManager
|
||||
{
|
||||
private static int SessionKeySize { get; } = 32; //32 bytes
|
||||
private int SessionKeySize { get; } = 64; //n bytes
|
||||
private string ConnectionString { get; set; }
|
||||
|
||||
public static string CreateSessionToken()
|
||||
public SessionManager()
|
||||
{
|
||||
if (AppSettingsManager.TryGetConnectionStringByName("MainDataConnectionString", out string connection))
|
||||
ConnectionString = connection;
|
||||
else
|
||||
throw new Exception("Failed to get connection string.");
|
||||
}
|
||||
|
||||
public string CreateSessionToken()
|
||||
{
|
||||
var token = new byte[SessionKeySize];
|
||||
|
||||
@@ -17,5 +27,14 @@ namespace SecureCore.Authentication
|
||||
|
||||
return Convert.ToBase64String(token);
|
||||
}
|
||||
|
||||
//public string CreatePasswordRecoveryKey(string userName)
|
||||
//{
|
||||
|
||||
// using (var connection = new SqlConnection(ConnectionString))
|
||||
// {
|
||||
|
||||
// }
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user