Bypassing authentication

J

John

Hi

I have established form authentication so every page on the site send the
access to a specific login page. I need however to bypass the authentication
for my web service page to allow it to be accessed without login. How can I
selectively exclude a page from form authentication?

Thanks

Regards
 
T

Teemu Keiski

In web.config with <location> element

<configuration>
<location path="exclude.aspx">
<system.web>
<authorization>
<allow users="?"/>
</authorization>
</system.web>
</location>

<! -- Normal config goes here as before -->
<system.web>

</system.web>
</configuration>
 
J

John

I have used below but no luck. Am I missing something?

Thanks

Regards

<location path="~FolderA/FolderB/a.asmx">
<system.web>
<authorization>
<allow users="?"/>
</authorization>
</system.web>
</location>
 
J

John

This worked (below). Note the * and no ~.

<location path="FolderA/FolderB/a.asmx">
<system.web>
<authorization>
<allow users="*"></allow>
</authorization>
</system.web>
</location>
 
T

Teemu Keiski

As I said, no tilde. ;-)

allow="?" means just that allow unauthenticated users to access the page
(not sure if that makes difference here, but that depends on how you users
are accessing it). allow="*" means that all are allowed.

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top