trying to add service reference to my windows 8 application. But the asmx file is inside a folder where logged in users with certain roles can view. Like a protected folder, i’m also using asp.net membership provider for the website. How can I add this reference or authenticate to it?
Thanks.
There is a simpler way to authorize your service users, this should resolve some of your issues.
First, put your service in a public folder, with no authorization at all. This will allow you to add a reference from a windows 8 app with no problems.
Then, in your service, create a method to authenticate your users:
This public method will be the first method your Windows 8 app should call.
Then you protect all other service methods with a
PrincipalPermissionattribute:Attributes will guard invocation of your service methods so that only users authenticated with the valid call to the
Loginmethod will be able to access your service.