0

I am new to ASP.NET development and moreover I am only extending an existing application which i did not create.

I have a working ASP.NET application which uses "Forms authentication" throughout all its pages. I have added a new webservice in a subfolder "webservices\Dummy.asmx". This webservice works fine but because it should be called by an external application which can't authenticate through a form, i need to enable "Integrated Windows Authentication (Basic Authentication or Digest Authentication)" ONLY for the subfolder "webservices".

I tried to configure it in IIS but it did not work. So that i can set a different authentication method i have to create the folder "webservices" as an "Application". But if i do so then my function stops working with the error "Could not create type 'Dummy'."

Is it possible to have one web application and to authentication methods ? If yes how is it configured in IIS ?

Or what would be the better way if i need ONLY one page (webservice) to use a different authentication then the rest of my application.

Thank you in advance for any information.

Bye

PS: I use Windows 2008 Server and the app runs on .NET Framwork 2.0

2 Answers 2

1

I tried to configure it in IIS but it did not work. So that i can set a different authentication method i have to create the folder "webservices" as an "Application". But if i do so then my function stops working with the error "Could not create type 'Dummy'."

This is the correct way. Can you explain the problem you are having here ? What is dummy ?

Mixing Forms and Windows Security in ASP.NET http://msdn.microsoft.com/en-us/library/ms972958.aspx

Sign up to request clarification or add additional context in comments.

7 Comments

When i create a new "Application" from my folder "webservice" then the file Dummy.asmx in this folder starts throwing an error. (Before that it worked fine.) The error is: Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. Parser Error Message: Could not create type 'Dummy'. Line 1: <%@ WebService Language="vb" Codebehind="Dummy.asmx.vb" Class="Dummy" %> Dummy=only an example name of my webservice
Maybe the problem is somewhere else. Can it be that once i create the new "application" then my Dummy.asmx looses the connection to the main DLL in the bin-folder and won't work anymore ? I am really a newbie here :-(((
Try creating the bin directory under "webservice" folder and putting the DLL there after you convert to application.
It works ! I have copied the whole "bin"-directory under the "webservice"-directory. And now i have two different authentication-methods. One for the main application, the other for the "webservices" application. Thanks a lot. I am now one step further. :-)
However it really does not look very clean. I would not really want to have two complete sets of DLL-directorie in one web. Is there a "cleaner" solution ? Can i somehow reference my bin-directory which is "one level" above ? Or how about a symlink. That could work. Or maybe i should not try to do this "add-on" inside this application at all and rather create a completely separate application in a new folder and copy the DLLs there. What would you suggest ?
|
0

Web services that live in a larger application often do not need to be protected. If that's acceptable in your scenario, you can use a standard web.config construct to allow anonymous access to the service while still protecting the rest of the application.

Add a location node to the main configuration node that defines the rules for just the web service:

<location path="webservices\Dummy.asmx">
    <system.web>
        <authorization>
            <!-- this overrides the parent app protection rules -->
            <allow users="*" />
        </authorization>
    </system.web>
</location>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.