我们通过"New"和"Old" portal在同一个AAD B2C 租户中注册了两个应用程序 .
使用“旧”应用程序凭据进行身份验证正常 . 使用“新”应用程序凭据 - 出现错误:
IDX10500:签名验证失败 . 无法解析SecurityKeyIdentifier:'SecurityKeyIdentifier ( IsReadOnly = False, Count = 1, Clause[0] = System.IdentityModel.Tokens.NamedKeySecurityKeyIdentifierClause ) '
使用在AAD B2C 租户中注册的应用程序使用Microsoft.Owin.Security.ActiveDirector库(以保护ASP.Net Web API)是正确的方法 .
附:我的问题是基于这个post .
1 回答
You should only create applications via the Azure AD B2C blade in the new Azure portal (portal.azure.com).
不要使用经典Azure门户(manage.windowsazure.com)为Azure AD B2C创建应用程序 .
If you want to secure a WebApp, you should use Owin's OpenIdConnectAuthentication . 本文档详细介绍了如何执行此操作:Sign-Up & Sign-In in a ASP.NET Web App
If you want to secure a WebAPI, you should use Owin's OAuthBearerAuthentication . 本文档详细介绍了如何执行此操作:Build a .NET web API
WebApp的示例配置:
Web API的示例配置: