using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Web; using System.Web.Security; using System.ServiceModel.Web; using TaloyhtioIntegration_resx = Taloyhtio.GeneralApi.Resources.Resources.TaloyhtioIntegration; using WebException = WcfRestContrib.ServiceModel.Web.Exceptions.WebException; namespace Taloyhtio.GeneralApi.WcfService { public class CustomCredentialsValidator : System.IdentityModel.Selectors.UserNamePasswordValidator { public override void Validate(string userName, string password) { if (!FormsAuthentication.Authenticate(userName, password)) { throw new WebException(HttpStatusCode.Forbidden, TaloyhtioIntegration_resx.SecurityNotAuthenticated); } } } }