我有一个使用基于索赔的(表单)身份验证的站点设置,并启用了匿名访问。

当用户登录到网站时,它们可能存在于表单数据库中,但不在SharePoint站点集合中。在这种情况下,spcontext.current.web.spuser返回null-即使它们已登录。

我可以使用的另一个与Spuser类似的对象吗?

有帮助吗?

解决方案

httpcontext.current.user.identity.isauthentication == true吗?如果是这样,请尝试在挖掘web.currentuser之前(httpcontext.current.side.name.name)拨打spcontext.current.web.ensureuser(httpcontext.current.user.name)

-oisin

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top