Claims Provider issues in your Server Farm: The user is not unique or doesn’t exist.


The custom claims provider in your server farm is activated for all the Web Applications by default as it has to be globally deployed. This may cause you an issue if you are using FBA on another Web Application and would return users even though the authentication provider is not your custom Trusted Claims provider. To make sure that you don’t get the error message

 

The user is not unique or doesn’t exist.

In the constructor of the custom claims provider set a boolean isTsClaims( is Trusted Claims) and load the FillResolve, FillHierarchy and FillSearch methods only if the boolean value is true.

 
SPSite site = SPContext.Current.Web.Site;
                    
SPIisSettings settings = site.WebApplication.IisSettings[SPUrlZone.Default];

if (settings.ClaimsAuthenticationProviders != null)
{
    foreach (SPAuthenticationProvider provider in settings.ClaimsAuthenticationProviders)
    {
        if (provider.DisplayName.Equals("YOURCLAIMPROVIDERNAME") 
            || site.WebApplication.IsAdministrationWebApplication)
        {
            isTsClaims = true;
        }
    }
}
else
{
    if (site.WebApplication.IsAdministrationWebApplication)
    {
        isTsClaims = true;
    }
}
About these ads

No comments yet.

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 81 other followers

%d bloggers like this: