简体   繁体   English

SharePoint 2010自定义声明提供程序

[英]SharePoint 2010 Custom Claims Provider

All, 所有,

I've recently tried to implement a custom claims provider inside SharePoint 2010. The claims get populated with some business logic from a database. 我最近尝试在SharePoint 2010中实现自定义声明提供程序。声明中填充了数据库中的一些业务逻辑。

The claims appear to be making it on to the users. 声明似乎正在向用户提出。 Which is a good first step. 这是一个很好的第一步。

The next step was to check to see if the people picker worked. 下一步是检查人员选择器是否工作。

The PeoplePicker can search and resolve the name if you click the "Check Names" button. 如果单击“检查名称”按钮,PeoplePicker可以搜索并解析名称。 HOWEVER... If you go into the PeoplePicker, and click Browse, then search for your claim, and select it and add it to the "Add" box, then click OK. 但是...如果进入PeoplePicker,然后单击“浏览”,然后搜索您的声明,然后选择它并将其添加到“添加”框中,然后单击“确定”。 Nothing happens, nothing is added to the Grant Permissions box. 没有任何反应,没有任何添加到“授予权限”框中。 Alternatively, if you just type in a claim and click the "check names" button, it will resolve it fine, but if you click OK, it blanks out the field and says its required. 另外,如果您仅键入索赔并单击“检查名称”按钮,它将很好地解决该问题,但是,如果单击“确定”,则该字段将变为空白并显示其必填字段。 Alternatively again, if you type in the claim and NOT click the "check names" button and just click "OK", you get an error message stating: The parameter loginName cannot be empty or bigger than 251 characters. 另外,如果您键入声明但不单击“检查名称”按钮,而只是单击“确定”,则会收到错误消息,指出:参数loginName不能为空或大于251个字符。

So in implementing the SPClaimProvider, there are 2 FillResolve methods, one that accepts a string, and one that accepts an SPClaim. 因此,在实现SPClaimProvider时,有2种FillResolve方法,一种方法接受字符串,而另一种方法接受SPClaim。 The one that accepts an SPClaim NEVER gets called, ever. 接受SPClaim的人永远不会被叫到。 Which I believe, if I understand right, is the one that does the final resolving to apply the security based off the claim in SharePoint. 如果我理解正确的话,我相信这是根据SharePoint中的声明对安全性进行最终解决的方法。

I've tried to be as detailed as possible without providing code, but please let me know whatever you need to know to help resolve this issue. 我尝试在不提供代码的情况下尽可能详细,但是请让我知道您需要帮助解决此问题的所有信息。

Thanks In Advance, Scott 预先感谢,斯科特

I know this is an old question, but I came across it and thought I could help the next person. 我知道这是一个老问题,但是我遇到了这个问题,并认为我可以帮助下一个人。 I usually see this effect "Click OK" and it goes away when I have an claim in the SPClaimProvider that is not in the Trusted Identity Provider (TIP). 我通常会看到此效果“单击确定”,当我在SPClaimProvider中拥有不在可信身份提供者(TIP)中的声明时,它就会消失。 For a claim to be chained from the Secure Token Service to the SharePoint system, it must be in the TIP. 要将声明从安全令牌服务链接到SharePoint系统,它必须位于TIP中。 If not SharePoint just discards it. 如果不是,SharePoint只是将其丢弃。

Hope that helps someone. 希望能对某人有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM