本文介绍了是否可以使用DI容器解析我的ClaimsAuthorizationManager的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用标准配置文件设置来运行自定义的ClaimsAuthorizationManager,但是我想将业务层服务注入实现中,但我无法弄清楚。

I've got my custom ClaimsAuthorizationManager working using the standard configuration file settings but I want to inject a business layer service into my implementation and I can't figure it out.

<system.identityModel>
    <identityConfiguration>
        <claimsAuthorizationManager
            type="Authentication.AuthorizationManager, Assembly" />
        <claimsAuthenticationManager
            type="Authentication.ClaimsTransformer, Assembly" />
    </identityConfiguration>
<system.identityModel>

我尝试使用静态FederatedAuthentication类手动设置它,但并不高兴。 ClaimsAuthorizationModule 始终为空。

I've tried manually setting it using the static FederatedAuthentication class but with no joy. The ClaimsAuthorizationModule is always null.

FederatedAuthentication.ClaimsAuthorizationModule.ClaimsAuthorizationManager = DependencyConfig.Container.Resolve<ClaimsAuthorizationManager>();

我已经尝试过此问题的答案,以确保模块已加载...

I've tried the answers from this question to try and ensure that the module is loaded...

...但它们没有效果。我还想知道其中的信息是否过时,因为我的应用程序中已经有与System.IdentityModel程序集同名的模块。

...but they don't have an effect. I also wonder if the information in those is dated because there's I've got modules with the same names from the System.IdentityModel assembly already in my application.

使用Thinktecture IdentityModel,但在那里看不到任何地方可以解决我的问题。这个问题似乎暗示了它,但没有给我解决方案。

这篇关于是否可以使用DI容器解析我的ClaimsAuthorizationManager的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-13 04:20