我已经让我的自定义 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 在运行时为 null https://stackoverflow.com/questions/8937123/federatedauthentication-wsfederationauthenticationmodule-is-null-at-runtime
……但它们没有效果。我还想知道这些信息是否已过时,因为我的应用程序中已经有来自 System.IdentityModel 程序集的同名模块。
我正在使用 Thinktecture IdentityModel,但我看不到其中可以解决我的问题的任何地方。这个问题似乎暗示了这一点,但没有给我解决方案。https://github.com/thinktecture/Thinktecture.IdentityModel/issues/9 https://github.com/thinktecture/Thinktecture.IdentityModel/issues/9
我已经解决了 null ClaimsAuthorizationModule 的问题,答案已过时,我需要使用 System.IdentityModel.Services 程序集中的声明身份验证模块。现在我可以注入 ClaimsAuthManager 但 CheckAccess 没有被调用。