2016-12-27 41 views
0

我有一些只有用戶可以使用的web服務。但是,我需要一個允許公衆訪問和未註冊的成員使用。允許公開使用WebService DNN API

我已經給我的DNN模塊權限,未經授權查看所有用戶和我的webmethod這樣:

<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)> 

但它仍然不適用於未登錄的用戶。

任何想法?

回答

2

要使服務完全打開,請添加<AllowAnonymous>屬性。

相關問題