[英]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.