public static bool IsMethodActive(this IExternalAuthenticationMethod method, ExternalAuthenticationSettings settings) { if (method == null) { throw new ArgumentNullException("method"); } if (settings == null) { throw new ArgumentNullException("settings"); } if (settings.ActiveAuthenticationMethodSystemNames == null) { return(false); } foreach (string activeMethodSystemName in settings.ActiveAuthenticationMethodSystemNames) { if (method.PluginDescriptor.SystemName.Equals(activeMethodSystemName, StringComparison.InvariantCultureIgnoreCase)) { return(true); } } return(false); }
/// <summary> /// Check whether external authentication method is active /// </summary> /// <param name="method">External authentication method</param> /// <returns>True if method is active; otherwise false</returns> public virtual bool IsExternalAuthenticationMethodActive(IExternalAuthenticationMethod method) { if (method == null) { throw new ArgumentNullException(nameof(method)); } if (_externalAuthenticationSettings.ActiveAuthenticationMethodSystemNames == null) { return(false); } foreach (var activeMethodSystemName in _externalAuthenticationSettings.ActiveAuthenticationMethodSystemNames) { if (method.PluginDescriptor.SystemName.Equals(activeMethodSystemName, StringComparison.InvariantCultureIgnoreCase)) { return(true); } } return(false); }
/// <summary> /// Check whether external authentication method is active /// </summary> /// <param name="method">External authentication method</param> /// <param name="settings">External authentication settings</param> /// <returns>True if method is active; otherwise false</returns> public static bool IsMethodActive(this IExternalAuthenticationMethod method, ExternalAuthenticationSettings settings) { return(false); }
public static AuthenticationMethodModel ToModel(this IExternalAuthenticationMethod entity) { return(entity.MapTo <IExternalAuthenticationMethod, AuthenticationMethodModel>()); }
public static AuthenticationMethodModel ToModel(this IExternalAuthenticationMethod entity) { return(Mapper.Map <IExternalAuthenticationMethod, AuthenticationMethodModel>(entity)); }