Today I was challenged with creating an authenticated, cross-domain, WCF service that returns JSONP.
Using the ‘out of the box’ WCF configurations this is not possible. If you attempt to use authentication with an endpoint that allows cross-site scripting, you will recieve an error message like this –
To get around this restriction (It’s not a bug) we can use a custom encoder factory/binding/etc…
In my application, I am using the sample JSONP library that was provided by Miscrosoft.
Then added the appropriate authentication requirement in the web config.
<httpTransport manualAddressing=”true” authenticationScheme=”Negotiate” />
If anyone needs help with this, First try to implement the JSONP library from Microsoft and let me know if you get stuck. I’ll try to help you configure your app.