How to Authenticate and Authorize every WCF call?

五迷三道 提交于 2019-12-03 07:03:02

This is the recommended default behavior - each call to the WCF service gets a new instance of the service, and each call is authenticated and authorized.

Just make sure not to enable things like session mode in WCF, and don't go down the path of a WCF singleton.

Just keep a regular, standard "per-call" WCF service - no issue there.

If you're on a corporate LAN, you could also think about using Windows credentials for authentication (which is the default for wsHttpBinding and netTcpBinding).

There's a really extensive WCF Security Guide which has tons of samples and how-to guides on how to set up certain scenarios of WCF security.

I would also recommend you check out The Fundamentals of WCF Security for a great intro to WCF and its security mechanisms.

A bit more advanced is the idea of Declarate WCF Security in which Juval Lowy introduces five security scenarios (that's a very worthy read!) and encapsulates them into security attributes to be applied to your service contract(s).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!