I’ve been working with WCF services a lot lately, especially hosted in SharePoint. My Silverlight 2.0 application uses the services to interact with SharePoint, which works great. There are some posts about how to get started with them available, which is great.
the the architecture I’m using for my application, Forms authentication in SharePoint is a must, which means I wrote my own authentication provider. The WCF services however, don’t like that by default and returns a login screen which I can’t pass. Switching from Windows to Forms, break the application.
There is a solution however, to get the WCF services work under forms authentication as well in SharePoint. Note that you must enable cookies (and store the login) to make this solution work. So,
<add name="Session" type="System.Web.SessionState.SessionStateModule"/>
<pages enableSessionState="true" enableVie…
<binding name="BasicHttpBinding" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647"> <security mode="TransportCredentialOnly"> <transport clientCredentialType="None" /> </security> </binding>
and..
<endpoint address="/_layouts/Services/Service.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding" contract="WiZZiX.Services.Service" name="WiZZiX.Services.Service"> <security mode="Transport"> <transport clientCredentialType="None" proxyCredentialType="None" realm="" /> <message clientCredentialType="UserName" algorithmSuite="Default" /> </security> </endpoint>
Now, the WCF service works great with forms authentication within the context of SharePoint!
Note that with this configuration, windows authentication doesn’t work anymore, so it’s either windows or forms, not mixed.
With thanks to PaulB for helping me out.
Remember Me
Powered by: newtelligence dasBlog 1.9.7174.0
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
E-mail
Theme design by Jelle Druyts