0

After publishing the fresh Habitat project to Sitecore 9.1.1 fresh instance, I am facing the below error. I tried but failed to solve this issue.

Any help would be appreciated.

Cannot create identity provider with nonexistent Sitecore domain "facebook"

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: Cannot create identity provider with nonexistent Sitecore domain "facebook"

Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

3
  • @MahendraShekhawat No I didn't. Not in any of the owin config file
    – Aravindan
    Commented Oct 23, 2019 at 10:49
  • Should i have to add it in Sitecore.Owin.Authentication.config file
    – Aravindan
    Commented Oct 23, 2019 at 11:03
  • My bad...I didn't read the fresh Habitat. did you perform all the steps for the facebook login - github.com/Sitecore/Habitat/wiki/01-Getting-Started? see the last section here Commented Oct 23, 2019 at 11:09

2 Answers 2

1

Please check your patch config file , under the identityproviders section , there identiyprovider id and param is set to facebook.

<identityProviders hint="list:AddIdentityProvider">
        <identityProvider id="**AzureAdB2C**" type="Sitecore.Owin.Authentication.Configuration.DefaultIdentityProvider, Sitecore.Owin.Authentication">
          <param desc="name">**AzureAdB2C**</param>
          <param desc="domainManager" type="Sitecore.Abstractions.BaseDomainManager" resolve="true" />
 <caption>AzureAdB2C</caption>

You could either change it to Sitecore or create a new domain in Sitecore -> domain manager with the name "facebook"

In above example , i have used AzureAdB2c as name of IdentityProvider and domain. Please change according to your setup.

1

I found solution which allow me to run the sitecore without Facebook authentication.

Need to comment the below line in Feature.Accounts.config file. This helped me to solve my issue.

<identityProvider id="Facebook" type="Sitecore.Owin.Authentication.Configuration.DefaultIdentityProvider, Sitecore.Owin.Authentication">
                <param desc="name">Facebook</param>
                <param desc="domainManager" type="Sitecore.Abstractions.BaseDomainManager" resolve="true" />
                <caption>Facebook</caption>
                <domain>facebook</domain>
                <transformations hint="list:AddTransformation">
                </transformations>
            </identityProvider>

and

<owin.identityProviders>
            <processor type="Sitecore.Feature.Accounts.Infrastructure.Pipelines.IdentityProviders.Facebook, Sitecore.Feature.Accounts" resolve="true" />
        </owin.identityProviders>

In Habitat.Website.config comment the below line

<identityProvidersPerSites>
            <mapEntry name="habitat" type="Sitecore.Owin.Authentication.Collections.IdentityProvidersPerSitesMapEntry, Sitecore.Owin.Authentication" resolve="true">
                <sites hint="list">
                    <site>habitat</site>
                </sites>
                <identityProviders hint="list:AddIdentityProvider">
                    <identityProvider ref="federatedAuthentication/identityProviders/identityProvider[@id='Facebook']"/>
                </identityProviders>
                <externalUserBuilder type="Sitecore.Owin.Authentication.Services.DefaultExternalUserBuilder, Sitecore.Owin.Authentication" resolve="true">
                    <param desc="isPersistentUser">true</param>
                </externalUserBuilder>
            </mapEntry>
        </identityProvidersPerSites>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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