繁体   English   中英

如何在 c# webapi 中使用 IdentityModel.OidcClient 来验证和验证从支持 openid 连接的活动目录服务生成的令牌?

[英]How can I use IdentityModel.OidcClient in a c# webapi to verify and validate token generated from active directory service supporting openid connect?

我在 c# 和前端 angular 应用程序中有一个 webapi。 angular 应用程序正在调用活动目录服务,例如 azure 广告,以获取访问令牌。 在随后的 webapi 调用中,web api 应用程序需要验证访问令牌。

到目前为止,我的 webapi 一直在使用 Microsoft.Owin.Security jwt 令牌验证。 我想用 IdentityModel.OidcClient 替换 Microsoft.Owin.Security (因为这是经过认证的 c# openid 连接库)。 请帮助我了解如何使用 OidcClient 框架来验证令牌。

To validate tokens you should not use IdentityModel.OidcClient, instead you should use the Microsoft.AspNetCore.Authentication.JwtBearer Nuget Package to properly validate JWT tokens in an API.

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM