【发布时间】:2020-05-14 20:03:27
【问题描述】:
从最近的发布和下面的对话中,它说现在 Katana(4.1.0) 支持带有自动代码兑换的代码流(这意味着我们没有显式调用 tokenendpoint 来兑换 idtoken、accesstoken 等的代码)
https://github.com/aspnet/AspNetKatana/pull/297
所以,我已经升级了 Katana dll 并拥有了 p
Notifications = new OpenIdConnectAuthenticationNotifications()
{
RedirectToIdentityProvider = OnRedirectToIdentityProvider,
//MessageReceived = OnMessageReceived, -- previous I were calling token endpoint in this notification
SecurityTokenReceived = notification => Task.FromResult(0),
SecurityTokenValidated = OnSecurityTokenValidated,
AuthenticationFailed = OnAuthenticationFailed,
AuthorizationCodeReceived = AuthorizationCodeReceived, -- added this notification per latest improvements
TokenResponseReceived = TokenResponseReceived
}
以及这里的实现
private Task AuthorizationCodeReceived(AuthorizationCodeReceivedNotification arg)
{
return Task.FromResult(0);
}
并且我希望中间件调用令牌端点来兑换身份验证代码,这不会发生。
我在这里遗漏了什么吗?我应该在此处添加一些代码以供中间件兑换代码吗?请多多指教。。
更新:
我在下面按照其他博客设置,
args.App.UseOpenIdConnectAuthentication(
new OpenIdConnectAuthenticationOptions
{
//other properties removed for brevity
SaveTokens = true,
RedeemCode = true,
}
中间件仍然不会自动兑换代码。
只是一个想法,.NET 核心是否支持此功能?我实际上使用的是 .NET Framework 4.7.1。
【问题讨论】:
标签: asp.net owin openid-connect katana owin-middleware