Hitting a ADO.NET Data Services from WPF client, forms authentication
-
10-07-2019 - |
Question
There are a number of questiosn on StackOverflow that ALMOST hit this topic head on, but they are either for other technologies, reference obsolets information or don;t supply an answer that I can suss out. So pardon the almost duplication :)
I have a working ADO.NET Data Service, and a WPF client that hits it. Now that they are working fine I want to add authentication / security to the system. My understanding of the steps so far is...
- Turn on forms authentication and configure it on the server (I have an existing asp.net membership service DB for other aspects of this app, so that isnt a problem) so that it is required for the service URL
- In WCF apply for and recieve a forms authentication "ticket" as part of a login routine
- Add that "ticket" to the headers of the ADO.NET service calls in WPF
- Profit!
All well and good - but does anyone have a line on a soup to nuts code sample, using the modern releases of these technologies?
Thanks!
Solution
I have an example of doing this from Silverlight on my blog.
Check it out here : Forms Authentication and ADO.NET Data Services
You should be able to adapt this to a WPF application with minor code changes.