从最近的版本和下面的对话中可以看出,现在Katana(4.1.0)支持自动代码兑换的代码流(这意味着我们没有显式地调用令牌端点来兑换idtoken、accesstoken等的代码)
https://github.com/aspnet/AspNetKatana/pull/297
所以,我已经升级了Katana dlls并让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框架4.7.1。
发布于 2020-01-30 22:25:33
实际上,上面的设置是有效的,并且正在进行token api调用,但是由于我的设置中缺少"clientsecret“而失败,一旦纠正了所有的工作,就只需要fine.Thank你。
https://stackoverflow.com/questions/59965137
复制相似问题