Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have got a problem, with user logon. Befor a logon name I have got i:0#.w| and next i xave got a loigin name. How to get only Login name ? Because this i:0#.w| I have got everywere in info Path, In Excel and many more. How Could I get it of from Central Administration of Sharepoint ?

share|improve this question

2 Answers 2

up vote 5 down vote accepted

Your web application is using claims based authentication and you can't get rid of that part from Central Administration unless you use a classic based authentication for a web application (in SP 2013 that is possible only using PowerShell when creating a new web application).

To remove that part from the user names in InfoPath, Excel, etc. you have to split the string and get only DOMAIN\Username.

When coding you can use the following snippet:

SPClaimProviderManager claimsManager = SPClaimProviderManager.Local;

if (claimsManager != null)
{
    if (SPClaimProviderManager.IsEncodedClaim(usernameString))
        username = claimsManager.DecodeClaim(usernameString).Value;
    else
        username = usernameString;
}
share|improve this answer

I faced the same situation and the only thing I could find was splitting the string and take only the user name. So the solution is sub string.

Fore more info check this.

share|improve this answer
    
Thanks a lot for the answers. This is a very strange disadventage with a ,igration tooo. –  Grzegorz Z Aug 27 at 10:45

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.