【问题标题】:Allow public usage of WebService DNN API允许公开使用 WebService DNN API
【发布时间】:2023-04-02 20:43:01
【问题描述】:

我有一些只有登录用户才能使用的网络服务。但是,我需要一个允许公共访问和非注册成员使用。

我已授予未经授权和所有用户查看我的 DNN 模块的权限,以及我的网络方法:

   <HttpGet>
    Public Function FindSomeone(q As String) As HttpResponseMessage
        Try
            Return Request.CreateResponse(HttpStatusCode.OK, "ok".ToJson)

        Catch exc As Exception
            Return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc)
        End Try
    End Function

我已经尝试添加:

<DnnModuleAuthorize(AccessLevel:=SecurityAccessLevel.View)>

 <DnnModuleAuthorize(AccessLevel:=SecurityAccessLevel.Anonymous)>

但它仍然不适用于未登录的用户。

有什么想法吗?

【问题讨论】:

    标签: web-services dotnetnuke dotnetnuke-8


    【解决方案1】:

    要使服务完全开放,请添加&lt;AllowAnonymous&gt; 属性。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-03-17
      • 2015-07-11
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多