This commit is contained in:
@@ -663,6 +663,24 @@ namespace AyaNova.Api.Controllers
|
||||
await ct.SaveChangesAsync();
|
||||
return NoContent();
|
||||
}
|
||||
|
||||
|
||||
//generate an internal JWT key for reporting purposes used by corejobnotify to send reports as manager account
|
||||
internal static string GenRpt()
|
||||
{
|
||||
byte[] secretKey = System.Text.Encoding.ASCII.GetBytes(ServerBootConfig.AYANOVA_JWT_SECRET);
|
||||
var iat = new DateTimeOffset(DateTime.Now.ToUniversalTime(), TimeSpan.Zero);
|
||||
var exp = new DateTimeOffset(DateTime.Now.AddMinutes(ServerBootConfig.AYANOVA_REPORT_RENDERING_TIMEOUT).ToUniversalTime(), TimeSpan.Zero);
|
||||
var payload = new Dictionary<string, object>()
|
||||
{
|
||||
{ "exp", exp.ToUnixTimeSeconds().ToString() },//in payload exp must be in unix epoch time per standard
|
||||
{ "iss", "ayanova.com" },
|
||||
{ "id", "1"},
|
||||
{ "int","1" }
|
||||
};
|
||||
return Jose.JWT.Encode(payload, secretKey, Jose.JwsAlgorithm.HS256);
|
||||
}
|
||||
|
||||
//------------------------------------------------------
|
||||
|
||||
public class CredentialsParam
|
||||
|
||||
Reference in New Issue
Block a user