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

This article http://www.thesharepointbar.com/?p=340 how to limit a read on a user in BCS, but we can't find the correct syntax for fba-users. (MS Quote: If the login mode for the user is claims-based, then the value passed is the unique value that identifies the user (for example, membership: username, username@provider.com)).

So we asked ourselves how to write qualifiedusername behind the scenes with @Username in a create part of BCS (and see what it wrote). But we couldn't find a way for that either. Thanks in advance. Rob

share|improve this question

1 Answer 1

Given a login name (SPContext.Current.Web.CurrentUser.LoginName) of "i:0#.f|fbaprovider|user" the following will result in "user"

string result = LoginName;
if (Microsoft.SharePoint.Administration.Claims.SPClaimProviderManager.IsEncodedClaim(LoginName))
{
    result = Microsoft.SharePoint.Administration.Claims.SPClaimProviderManager.Local.DecodeClaim(LoginName).Value;
}
share|improve this answer

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.