当使用 IdentityServer 3 时签名证书(用于签名 jwt 令牌)过期会发生什么?
我不清楚,我找不到任何文档,除了可能会收到它已过期的警告。(参考https://identityserver.github.io/Documentation/docsv2/configuration/events.html)
是否有任何机制可以阻止使用过期的签名证书?
当验证由过期证书签名的令牌时,客户端(客户端是使用 IdentityServer 进行身份验证的 Web API)会发生什么?(例如,如果使用 https://github.com/IdentityServer/IdentityServer3.AccessTokenValidation作为中间件。)
我已使用WebJobs SDK将长时间运行的进程实现为WebJob.期待长时间运行的过程,因为我想要结果.
public async Task ProcessMessage([ServiceBusTrigger("queuename")] MyMessage message)
{
await Run(message.SomeProperty); // takes several minutes
// I want to do something with the result here later..
}
Run Code Online (Sandbox Code Playgroud)
我无法弄清楚的是为什么消息有时会被放弃,这当然会再次触发处理程序.我试图调试(本地),在ProcessMessage
完成之前设置断点,我可以看到它似乎成功完成.
WebJobs SDK的Sevice Bus部分负责消息锁更新,因此就我所理解的而言,这应该不是问题.
我错过了什么以及如何排除故障?
我有一个最简单的方法,将字符串解析为DateTime 但返回类型是DateTimeOffset?.
我期待输出
2011-01-11 00:00:00 +01:00
2011-10-11 00:00:00 +01:00
Run Code Online (Sandbox Code Playgroud)
但事实确实如此
2011-01-11 00:00:00 +01:00
2011-10-11 00:00:00 +02:00
Run Code Online (Sandbox Code Playgroud)
为什么我会这样做?我的测试程序如下.
class Program
{
static void Main(string[] args)
{
Console.WriteLine(Parse("20110111").ToString());
Console.WriteLine(Parse("20111011").ToString());
Console.ReadLine();
}
public static DateTimeOffset? Parse(string date)
{
DateTime parsedDate;
if (DateTime.TryParseExact(date, "yyyyMMdd", CultureInfo.InvariantCulture, DateTimeStyles.None, out parsedDate))
{
return parsedDate;
}
return null;
}
}
Run Code Online (Sandbox Code Playgroud)