string userName = null;
SPClaimProviderManager mgr = SPClaimProviderManager.Local;
if (mgr != null)
{
userName = mgr.DecodeClaim(SPContext.Current.Web.CurrentUser.LoginName).Value;
}
Get claim object:
string userName = null;
SPClaimProviderManager mgr = SPClaimProviderManager.Local;
if (mgr != null)
{
SPClaim claim = new SPClaim(SPClaimTypes.UserLogonName, "myuser", "http://www.w3.org/2001/XMLSchema#string", SPOriginalIssuers.Format(SPOriginalIssuerType.Forms, "myprovider"));
userName = mgr.EncodeClaim(claim);
}
No comments:
Post a Comment