简体   繁体   English

如果用户通过 Claims 的身份验证,如何签入 sharepoint?

[英]How to check in sharepoint if user is authenticated by Claims?

I've created few webparts in Sharepoint 2010. In current version users are authenticated by Ad login, but now custome want to customize it and allow authentication by AD login or by email name - using Claims (on different application pools).我在 Sharepoint 2010 中创建了几个 webpart。在当前版本中,用户通过广告登录进行身份验证,但现在客户想要自定义它并允许通过 AD 登录或 email 名称进行身份验证 - 使用声明(在不同的应用程序池上)。

My problem is that I have to check if user is authenticated by claims or not (to use this in my admin webpart).我的问题是我必须检查用户是否通过声明进行了身份验证(在我的管理 webpart 中使用它)。
I know that I can check user login name in sharepoint and if it is in this form: i:0#.f|ldapmember|user@example.com it means that I have Claims turned on.我知道我可以检查 sharepoint 中的用户登录名,如果它是这种形式: i:0#.f|ldapmember|user@example.com这意味着我打开了声明。

But maybe there is better way to check if Claims is turned on?但也许有更好的方法来检查索赔是否打开? Does anyone know that method?有谁知道这种方法吗?

You need to check if the username is encoded.您需要检查用户名是否已编码。

SPClaimProviderManager.IsEncodedClaim(SPContext.Current.Web.CurrentUser.LoginName)

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

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