How would a php or java client authenticate if I'm using WCF w/ forms auth?
Posted
by Toran Billups
on Stack Overflow
See other posts from Stack Overflow
or by Toran Billups
Published on 2009-02-04T21:01:15Z
Indexed on
2010/05/14
5:54 UTC
Read the original article
Hit count: 298
I have a generic proof of concept WCF service that is using forms authentication to secure access. All works great when my client is .NET (vb code below)
Dim client As SupplierServiceClient = New SupplierServiceClient()
client.ClientCredentials.UserName.UserName = "[email protected]"
client.ClientCredentials.UserName.Password = "password"
Dim SupplierList As List(Of Supplier) = client.GetSuppliers()
but as I want this to interop w/ anyone who can do SOAP 1.1/1.2 - how would a PHP or Java client connect?
My WCF web.config is listed below (fyi)
<system.serviceModel>
<services>
<service name="SampleApplicationWCF.Library.SupplierService" behaviorConfiguration="NorthwindBehavior">
<endpoint address="" name="wsHttpSupplierService" contract="SampleApplicationWCF.Library.ISupplierService" binding="wsHttpBinding" bindingConfiguration="wsHttp"/>
<endpoint address="https://server/SampleApplicationWCF/SupplierService.svc/Basic" name="basicHttpSupplierService" contract="SampleApplicationWCF.Library.ISupplierService" binding="basicHttpBinding" bindingConfiguration="basicHttp"/>
<endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="mex"/>
</service>
</services>
<bindings>
<wsHttpBinding>
<binding name="wsHttp">
<security mode="TransportWithMessageCredential">
<transport/>
<message clientCredentialType="UserName" negotiateServiceCredential="false" establishSecurityContext="true"/>
</security>
</binding>
</wsHttpBinding>
<basicHttpBinding>
<binding name="basicHttp">
<security mode="TransportWithMessageCredential">
<transport/>
<message clientCredentialType="UserName"/>
</security>
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="NorthwindBehavior">
<serviceMetadata httpGetEnabled="true"/>
<serviceAuthorization principalPermissionMode="UseAspNetRoles"/>
<serviceCredentials>
<userNameAuthentication userNamePasswordValidationMode="MembershipProvider"/>
</serviceCredentials>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
© Stack Overflow or respective owner