So, I basically made it all with wsHttpBindings and my WCF service, using my own HTTPS authentication.
The problem I encountered is related to customUserNamePasswordValidatorType:
<serviceCredentials> <userNameAuthentication userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType="CustomValidator.CustomUserNameValidator, CustomValidator"/> </serviceCredentials>
The routes below are here. I also created my own class:
namespace CustomValidator { public class CustomUserNameValidator : UserNamePasswordValidator { public override void Validate(string userName, string password) { if (null == userName || null == password) { throw new ArgumentNullException(); } if (!AuthenticateUser(userName, password)) throw new SecurityTokenValidationException("Invalid Credentials");
The error " Failed to load the file or assembly" CustomValidator "or one of its dependencies. The system cannot find the specified file. " And refers to the endpoint of customUserNamePasswordValidatorType - "..., CustomValidator".
I did not think this was a problem with my custom validator in my own namespace and class, but I do not see what else to do to make this work.
I tried with / without namespace at the beginning, swapping, etc. - nothing.
Hoping another pair of eyes can choose this.
Thanks.
EDIT system.serviceModel
<system.serviceModel> <bindings> <wsHttpBinding> <binding name="wsHttpEndpointBinding"> <security mode="TransportWithMessageCredential"> <transport clientCredentialType="None" /> <message clientCredentialType="UserName" /> </security> </binding> </wsHttpBinding> <webHttpBinding> <binding name="wsHttps" > <security mode="Transport"/> </binding> </webHttpBinding> <basicHttpBinding> <binding name="TransportSecurity"> <security mode="Transport"> <message clientCredentialType="UserName"/> </security> </binding> </basicHttpBinding> <customBinding> <binding name="CustomMapper"> <webMessageEncoding webContentTypeMapperType= "IndexingService.CustomContentTypeMapper, IndexingService" /> <httpTransport manualAddressing="true" /> </binding> </customBinding> </bindings> <serviceHostingEnvironment aspNetCompatibilityEnabled="false" /> <services> <service behaviorConfiguration="ServiceBehavior" name="Service"> <endpoint address="https://mysslserver.com/Service.svc" binding="wsHttpBinding" bindingConfiguration="wsHttpEndpointBinding" contract="IService" name="wsHttpEndpoint"> </endpoint> </service> </services> <behaviors> <endpointBehaviors> <behavior name="webBehavior"> <webHttp /> </behavior> </endpointBehaviors> <serviceBehaviors> <behavior name="ServiceBehavior"> <serviceSecurityAudit auditLogLocation="Application" suppressAuditFailure="false" serviceAuthorizationAuditLevel="Failure" messageAuthenticationAuditLevel="Failure" /> <serviceMetadata httpGetEnabled="false" httpsGetEnabled="true" httpsGetUrl="https://mysslserver.com/Service.svc"/> <serviceDebug includeExceptionDetailInFaults="false" /> <serviceCredentials> <userNameAuthentication userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType="CustomValidator.CustomUserNameValidator, CustomValidator"/> </serviceCredentials> </behavior> </serviceBehaviors> </behaviors> </system.serviceModel>
source share