How to check sharepoint if user is authenticated with claims?

I created several websites in Sharepoint 2010. In the current version, users authenticate by login, but now custome want to configure it and allow authentication by AD login or email - using Claims (in different application pools).

My problem is that I have to check if the user is checked for claims or not (use this in my admin web part).
I know that I can check the username in sharepoint, and if it is in this form: i: 0 # .f | ldapmember | user@example.com , this means that I have a complaint.

But maybe there is a better way to check if ads are enabled? Does anyone know this method?

+4
source share
1 answer

You need to check if the username is encoded.

SPClaimProviderManager.IsEncodedClaim(SPContext.Current.Web.CurrentUser.LoginName) 
+7
source

All Articles