我已经让我的自定义 ClaimsAuthorizationManager 使用标准配置文件设置工作,但我想将业务层服务注入到我的实现中,但我无法弄清楚。
<system.identityModel>
<identityConfiguration>
<claimsAuthorizationManager
type="Authentication.AuthorizationManager, Assembly" />
<claimsAuthenticationManager
type="Authentication.ClaimsTransformer, Assembly" />
</identityConfiguration>
<system.identityModel>
我尝试使用静态 FederatedAuthentication 类手动设置它,但没有任何乐趣。ClaimsAuthorizationModule
始终为空。
FederatedAuthentication.ClaimsAuthorizationModule.ClaimsAuthorizationManager = DependencyConfig.Container.Resolve<ClaimsAuthorizationManager>();
我已经尝试了这个问题的答案,以尝试确保模块已加载......
FederatedAuthentication.WSFederationAuthenticationModule 在运行时为空
...但它们没有效果。我还想知道这些信息是否过时,因为我的应用程序中已经有来自 System.IdentityModel 程序集的同名模块。
我正在使用 Thinktecture IdentityModel,但我看不到任何地方可以解决我的问题。这个问题似乎暗示了它,但没有给我一个解决方案。https://github.com/thinktecture/Thinktecture.IdentityModel/issues/9
我已经解决了 null ClaimsAuthorizationModule 的问题,答案已过时,我需要使用 System.IdentityModel.Services 程序集中的声明身份验证模块。现在我可以注入 ClaimsAuthManager 但不会调用 CheckAccess。