I'm trying to get a regular domain user name from CBA text that came from browser:
Microsoft.SharePoint.Administration.Claims.SPClaimProviderManager cpm = Microsoft.SharePoint.Administration.Claims.SPClaimProviderManager.Local; u1 = cpm.DecodeClaim(HttpContext.Current.User.Identity.Name).Value;
At the moment of last line execution HttpContext.Current.User.Identity.Name contains "0#.w|msk\\spadmin". Given that value as the input parameter, the function throws the following exception:
System.ArgumentException: Exception of type 'System.ArgumentException' was thrown. Parameter name: value at Microsoft.SharePoint.Administration.Claims.SPClaimEncodingManager.DecodeClaim(String value)
All what I wanted is to have msk\spadmin returned without low-level manual string parsing. Is there any way to get what I want basing on Sharepoint API?