Sharepoint 2010 - 如何访问请求对自定义角色提供程序进行身份验证的站点的 URL

发布于 2024-10-01 02:46:12 字数 586 浏览 3 评论 0原文

我目前正在将基于 Sharepoint 2007 构建的企业内容管理系统迁移到 Sharepoint 2010。该系统包含一个基于自定义表单的身份验证提供程序和一个自定义角色提供程序。用户角色映射存储在数据库中,如下所示:

userID roleID siteURL


21 15 www.sitea.com

21 10 www.siteb.com

22 15 www.sitea.com

在角色提供程序中,当前分配给的角色site是通过site URL获取和设置的。这是通过在其 Initilize 方法中设置角色提供程序的自定义属性(例如名为 SiteURL 的属性)来解决的,如下所示:

SiteURL = SPContext.Current.Web.Url;

但是,在 Sharepoint 2010 中,该行无法再使用。因为在 Sharepoint 2010 中声明授权,所以在名为 SecurityToken Web 服务的单独 Web 服务中调用自定义角色提供程序。所以 SPContext.Current 为空。

现在我必须找到一种替代方法来获取请求身份验证的站点 URL。你能给我一些建议吗?

I'm currently migrating an enterprise content management system that was built on Sharepoint 2007 to Sharepoint 2010. The system contains a custom forms based authentication provider and a custom role provider. User-role mappings are stored in the DB like below:

userID roleID siteURL


21 15 www.sitea.com

21 10 www.siteb.com

22 15 www.sitea.com

In the role provider the role that the is assigned to in the current site is get and set through site URL. This was solved by setting a custom property (e.g. property named SiteURL) of the role provider in its Initilize method like the following:

SiteURL = SPContext.Current.Web.Url;

However, in Sharepoint 2010 that line could not be used anymore. Because in Sharepoint 2010 claims authorization, custom role provider is called in a seperate web service named SecurityToken web service. So SPContext.Current is null.

Now I have to find an alternate way to get the site url that is requesting authentication. Would you provide me any suggestions?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不乱于心 2024-10-08 02:46:12

为每个域名设置单独的角色是否可行?

假设您向汽车经销商提供服务,并且每个经销商都有单独的域名和单独的角色(即,一个经销商的“经理”角色中的用户不应具有另一经销商的“经理”角色,因为他们是两个具有不同管理结构的独立公司)。您可以为 hensonford.com 拥有 Manager_HensonFord 角色,为 charlesford.com 拥有 Manager_CharlesFord 角色。

如果这不起作用,您能给我们更多关于它的用途的背景信息吗?

Would it work to set up separate roles for each domain name?

Lets suppose you provided services to car dealerships, and each dealership had a separate domain name, and separate roles (i.e., users in the 'Manager' role for one dealership should not have the 'Manager' role for another dealership, because they are two separate companies with different management structures). You could have a Manager_HensonFord role for hensonford.com, and a Manager_CharlesFord role for charlesford.com.

It that doesn't work, can you give us a little more context on what this is used for?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文