I'm trying to create a Facebook Social Login on my site and followed these steps.

  1. Have a Sitecore 8.0 initial release which is upgraded to update 5. The instance name is mysite.org and this is not a live site yet.
  2. Created an app in facebook and set the Site URL value as http://mysite.org
  3. Ensured that this items exists:


  4. Entered App ID, secret key and selected Facebook as network for this item:


  5. Checked that this item exists:

    /sitecore/layout/Renderings/Social MVC/Connector/Login with Facebook

    The controller for this is :

    Sitecore.Social.Facebook.Client.Mvc.Areas.Social.Controllers.FacebookConnectorController, Sitecore.Social.Facebook.Client.Mvc

  6. In the view, rendering the content as:


The html is rendered as:

<form action="/Social/FacebookConnector/Login" method="post" style="display:inline">
<input id="Parameters" name="Parameters" type="hidden" value="">  
<input type="image" title="Login with Facebook" src="/~/media/Images/Social/Connector/Facebook.ashx"> 

When I click on the facebook icon, the page does a postback and the url changes to:


In the showConfig.aspx, I can see this:

<social patch:source="Sitecore.Social.Facebook.config">
  <network name="Facebook" ItemId="{D7429409-D6DA-46CD-91DD-8702781AE3C4}" prefix="fb" icon="facebook" url="https://www.facebook.com">
        <provider type="Sitecore.Social.Facebook.Networks.Providers.FacebookProvider, Sitecore.Social.Facebook"/>

In the error log I find this:

31228 11:39:08 WARN Could not find type in ReflectionUtil.CreateObject: FacebookNetworkProvider
31228 11:39:08 ERROR Sitecore.Social: Can't cast the instance of type "" to NetworkProvider type
31228 11:39:08 ERROR Sitecore.Social: The network provider is not found for Facebook network.
Exception: Sitecore.Social.NetworkProviders.Exceptions.NetworkProviderNotFoundException
Message: The network provider is not found for Facebook network.
Source: Sitecore.Social.Client at Sitecore.Social.Client.Connector.SocialLogin.ProcessRequest(HttpContext httpContext)

There is no call to facebook site in the browser console. I followed the same steps for v8.2 and it worked.

What am I missing here.

  • do you have this config ? '/sitecore/social/networks/network' & facebook network added there ? Also please confirm that url facebook contains https & do have SSL binding of your app ? Mar 6, 2017 at 7:52
  • config?? do you mean sitecore item or .config file. If it is Sitecore item, then yes. I have mentioned that in my Step 3. In facebook App page, I have updated the site URL to mysite.org. Where should I do the SSL binding. But seeing the error log, I think its missing some type/dll
    – sukesh
    Mar 6, 2017 at 8:25
  • its missing the network, thats the error all about. can you open your showconfig.aspx through mysite.org/sitecore/admin/showconfig.aspx and confirm that you have this node ''/sitecore/social/networks/network' & network facebook node. Mar 6, 2017 at 9:00
  • It is available in the config and I have updated my question. Please have a look
    – sukesh
    Mar 6, 2017 at 10:04
  • Just to be sure: are all social related items (renderings, system, templates) published?
    – Thomas D
    Mar 6, 2017 at 13:05

2 Answers 2


It would appear to me that based on the above error messages and defined configurations, that somehow, "FacebookNetworkProvider" was set as the type of the Facebook Network Provider configuration "type". Similar to so:

<social patch:source="Sitecore.Social.Facebook.config">
  <network name="Facebook" ItemId="{D7429409-D6DA-46CD-91DD-8702781AE3C4}" prefix="fb" icon="facebook" url="https://www.facebook.com">
        <provider type="FacebookNetworkProvider, Sitecore.Social.Facebook"/>

However, your provided configuration doesn't appear to indicate this. However, the provided error messages do.

So how did I arrive at this conclusion? Let's step through backward beginning with the error message.

WARN Could not find type in ReflectionUtil.CreateObject: FacebookNetworkProvider

This error message contains one clear clue: FacebookNetworkProvider which is a string representation of the class that RefelctionUtil.CreateObject is expecting. We can see that here:

public static object CreateObject(string assembly, string className, object[] parameters)
  Assembly assembly1 = ReflectionUtil.LoadAssembly(assembly);
  if (assembly1 != (Assembly) null)
    Type type = assembly1.GetType(className, false, true);
    if (type != (Type) null)
      return ReflectionUtil.CreateObject(type, parameters);
    Log.Warn("Could not find type in ReflectionUtil.CreateObject: " + className, (object) typeof (ReflectionUtil));
  return (object) null;

Notice that className is used in the error message. However, most class names should be in the form of Some.Name.Space.Class (In this case, it should be Sitecore.Social.Facebook.Networks.Providers.FacebookProvider). In addition, ReflectionUtil is specifically using the CreateObject(string assembly, string className, object[] parameters) method because it detected a comma in the typeName

public static object CreateObject(string typeName, object[] parameters)
  if (typeName == null || typeName.Length == 0)
    return (object) null;
  int length = typeName.IndexOf(',');
  if (length >= 0)
    string className = typeName.Substring(0, length).Trim();
    return ReflectionUtil.CreateObject(typeName.Substring(length + 1).Trim(), className, parameters);



But, this only provides a warning and instead returns null for the value of the created object, which in this case is supposed to be a network provider.

ERROR Sitecore.Social: Can't cast the instance of type "" to NetworkProvider type

So, now that the Reflection.Util has tried to create a FacebookNetworkProvider to wit it had zero success in doing, the NetworkProviderFactory checks to see if the object returned is of subtype NetworkProvider.

public NetworkProvider GetNetworkProvider(Application application)
  Assert.IsNotNull((object) application, "Application is not defined");
  Assert.IsNotNull((object) application.Network, "Network of application is not defined");
  string providerTypeName = this.GetNetworkProviderTypeName(application.Network.Name);
    object obj = ReflectionUtil.CreateObject(providerTypeName, new object[1]
      (object) application
    if (!(obj is NetworkProvider))
      this.logManager.LogMessage(string.Format((IFormatProvider) CultureInfo.CurrentCulture, "Can't cast the instance of type \"{0}\" to NetworkProvider type", new object[1]
      }), Sitecore.Social.Infrastructure.Logging.LogLevel.Error, (object) this);
    return obj as NetworkProvider;
  catch (Exception ex)
    this.logManager.LogMessage(ex.Message, Sitecore.Social.Infrastructure.Logging.LogLevel.Error, (object) this, ex);
  return (NetworkProvider) null;

Since it is not, NetworkProviderFactory logs an error to the log indicating Can't cast the instance of type \"{0}\" to NetworkProvider type", new object[1], which in this case object[1] is null because no provider object was created, and nulls translate to nothing in string format notation hence the empty quotes in the error message.

ERROR Sitecore.Social: The network provider is not found for Facebook network.

Last but not least, is the SocialLogin.ProcessRequest() method ends up throwing an error (in a try catch)

    NetworkProvider networkProvider = ExecutingContext.Current.IoC.Get<INetworkProviderFactory>().GetNetworkProvider(authArgs.Application);
    string name = authArgs.Application.Network.Name;
    if (networkProvider == null)
      throw new NetworkProviderNotFoundException(name);

Because NetworkProviderNotFoundException() is not listed as one of the Exception classes to catch, it falls into the Exeception catch:

  catch (Exception ex)
    AuthException authException1 = new AuthException();
    authException1.DetailedMessage = ex.Message;
    AuthException authException2 = authException1;
    ExecutingContext.Current.IoC.Get<ILogManager>().LogMessage(authException2.DetailedMessage, Sitecore.Social.Infrastructure.Logging.LogLevel.Error, (object) this, ex);
    Guid exceptionKey = new ExceptionManager().Put(new SocialExceptionInfo((ISocialException) authException2));
    SocialLogin.RedirectWithError(authArgs, exceptionKey, httpContext);

This is important, because the SocialLogin.RedirectWithError will actually redirect the client browser to the Callback Url with query parameters with state and authError which you are seeing.


private static void RedirectWithError(AuthArgs authArgs, Guid exceptionKey, HttpContext httpContext)
  if (authArgs == null)
    httpContext.Response.ContentType = "text/plain";
    httpContext.Response.Write(Translate.Text("Session has been expired."));
    string str = authArgs.InternalData == null || authArgs.InternalData["UrlReferrer"] == null ? (string) null : authArgs.InternalData["UrlReferrer"].ToString();
    string uri = authArgs.CallbackUrl ?? str;
    if (uri == null)
    UriBuilder uriBuilder = new UriBuilder(uri);
    SafeDictionary<string> queryString = WebUtil.ParseQueryString(uriBuilder.Query);
    if (exceptionKey != Guid.Empty)
      queryString["authError"] = exceptionKey.ToString();
    queryString["state"] = authArgs.StateKey.ToString();
    uriBuilder.Query = WebUtil.BuildQueryString(queryString, false, false);
    RedirectUtil.Redirect(uriBuilder.ToString(), httpContext);

Auth Error Messages

Coincidently, any time that the Social Connect encounters an error during this process, it saves the error message to the client browsers HttpContext.Current.Session as a Hashtable of exceptions called socialExceptionCollection, where the key of the exception thrown equal the Guid that is provided in the authError query string parameter.

Additional Possibilities

  1. In trying to figure how in the world this is occuring, another possibility is that there is an additional config (or multiple configs) laying around in the Include folder that potentially could be interferring with this node. (This is an assumption).

  2. Additionally, I would make sure that for some reason, the facebook network config node doesn't show up more than once in the ShowConfig.aspx.

  • An excellent insight into how this actually works. Disappointlingly poor docs still on Sitecore. There is some info here that I wasn't aware of despite hours of poking about in the decompiled assemblies! Thanks
    – geedubb
    Sep 14, 2018 at 13:29

Please cross verfiy below:

  1. Find below Social Network configuration for facebook which is required: under '/sitecore/social/networks/network' using /sitecore/admin/showconfig.aspx Social Network Config

  2. Make sure you have 'Sitecore.Social.Facebook.dll' & appropriate version in your bin folder since you have "reflectionUtil.CreateObject: Sitecore.Social.Facebook.Networks.Providers.FacebookProvidererror"error

  • Sure Thank you. But this is already there in my config. The error in log is Could not find type in ReflectionUtil.CreateObject: Sitecore.Social.Facebook.Networks.Providers.FacebookProvider
    – sukesh
    Mar 6, 2017 at 10:22
  • did you check this config from sitecore/admin/showconfig.aspx ? Mar 6, 2017 at 10:42
  • also check you have Sitecore.Social.Facebook.dll in your bin folder Mar 6, 2017 at 10:48

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.