【问题标题】:Use Windows Authentication in WCF on Http Post Methods only仅对 Http Post 方法在 WCF 中使用 Windows 身份验证
【发布时间】:2013-02-26 16:35:32
【问题描述】:

我已经设置了一个安静的 WCF 服务,它向需要它们的任何人提供图像(它们不是安全敏感的),但我希望能够使用本地域中的应用程序将图像推送到服务和服务保存它们以供人们从外部访问。

所以我想发布只需要 Windows 身份验证的方法,这可能吗?如果可以,请知道该怎么做吗?

【问题讨论】:

    标签: wcf http-post windows-authentication


    【解决方案1】:

    在方法前使用[Authorize][HttpPost],如:

    [Authorize]
    [HttpPost]
    public ActionResult Method()
    

    这篇文章有你需要知道的一切 http://www.asp.net/mvc/tutorials/older-versions/security/authenticating-users-with-windows-authentication-cs

    【讨论】:

    • 虽然我没有使用 MVC,它是一个安静的 WCF Web 服务,但不是 MVC。
    猜你喜欢
    • 2012-09-29
    • 1970-01-01
    • 2012-12-26
    • 1970-01-01
    • 2011-10-09
    • 2011-07-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多