How to get domain\user notation of an account if it is in claim format

You can convert claim format into domain\user format  ;

string Username;
mgr = SPClaimProviderManager.Local;
if (mgr != null && SPClaimProviderManager.IsEncodedClaim(SPContext.Current.Web.CurrentUser.LoginName))
Username= mgr.DecodeClaim(SPContext.Current.Web.CurrentUser.LoginName).Value;
Username= SPContext.Current.Web.CurrentUser.LoginName;


More details of the SPClaimProviderManager methods:




About bpostaci
Escalation Engineer in Microsoft.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: