0

I have some webservices which only logged on users can use. However, I need one to allow public access and to non-registered members to use as well.

I have given my DNN module permissions to be viewed by Unauthorized and All users and my webmethod as such:

   <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

I have tried adding:

<DnnModuleAuthorize(AccessLevel:=SecurityAccessLevel.View)>

and

 <DnnModuleAuthorize(AccessLevel:=SecurityAccessLevel.Anonymous)>

but it still doesn't work for users who are not logged on.

Any ideas?

alwaysVBNET
  • 3,150
  • 8
  • 32
  • 65

1 Answers1

2

To make the services completely open, add the <AllowAnonymous> attribute.

Fix It Scotty
  • 2,852
  • 11
  • 12