예제 #1
0
        public virtual List <SocialAuthenticationMethodModel> PrepareSocialMethodsModel()
        {
            var model = new List <SocialAuthenticationMethodModel>();
            var activeSocialPlugins = _socialPluginService.GetSocialPlugins(true);

            foreach (var eam in activeSocialPlugins)
            {
                var    eamModel                  = new SocialAuthenticationMethodModel();
                string actionName                = "";
                string controllerName            = "";
                RouteValueDictionary routeValues = null;
                var entryClass = GetEntryPoint(eam.AssemblyName, eam.AuthenticationMethodServiceNamespace, eam.AuthenticationMethodService, "GetPublicInfoRoute");
                if (entryClass != null)
                {
                    entryClass.GetPublicInfoRoute(out actionName, out controllerName, out routeValues);
                    eamModel.ActionName     = actionName;
                    eamModel.ControllerName = controllerName;
                    eamModel.RouteValues    = routeValues;
                    eamModel.DisplayName    = eam.DisplayIdentifier;
                    model.Add(eamModel);
                }
            }

            return(model);
        }
 public virtual IList <SocialProvider> LoadActiveSocialAuthenticationMethods(bool?onlyActive = null)
 {
     return(_socialPluginService.GetSocialPlugins(onlyActive: onlyActive).ToList());
 }