Avoid Authentication with nuget Elmah.Mvc

56 views
Skip to first unread message

Rogerio Potenza

unread,
Oct 6, 2017, 3:57:20 PM10/6/17
to ELMAH
Hello,

     I'm trying to avoid authentication with Elmah but it always force me to login in before looking the logs.
   
     Here some configuration of my webconfig:

     <add key="elmah.mvc.disableHandler" value="false" />
    <add key="elmah.mvc.disableHandleErrorFilter" value="false" />
    <add key="elmah.mvc.requiresAuthentication" value="false" />
    <add key="elmah.mvc.IgnoreDefaultRoute" value="false" />
    <add key="elmah.mvc.allowedRoles" value="*" />
    <add key="elmah.mvc.allowedUsers" value="*" />
    <add key="elmah.mvc.route" value="elmah" />
    <add key="elmah.mvc.UserAuthCaseSensitive" value="true" />

 <sessionState timeout="80"></sessionState>
    <authentication mode="Forms">
      <forms loginUrl="~/Conta/Login" timeout="60" />
    </authentication>


     I tried many configurations n webconfig, but it did not work.
     Is someone solved a issue lije that?
     Could you help me?

    Regards, Rogério.

Atif Aziz

unread,
Oct 7, 2017, 5:12:26 AM10/7/17
to el...@googlegroups.com
I wouldn't recommend having your site secured by forms login but leaving your error log administration page open.

Anyway, this question doesn't seem to have much to do with ELMAH itself.

- Atif

--
You received this message because you are subscribed to the Google Groups "ELMAH" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elmah+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Rogerio Potenza

unread,
Oct 9, 2017, 6:55:21 AM10/9/17
to el...@googlegroups.com
Hello Atif!

      Is forms login not secure to use in MVC? Do I have to use (always) authentication to access the elmah home page? 

Atif Aziz

unread,
Oct 9, 2017, 1:34:29 PM10/9/17
to el...@googlegroups.com
I think you misunderstood me. I meant that you shouldn't leave the error log page open to anyone while the rest of your site is secured by forms login.

- Atif

Rogerio Potenza

unread,
Oct 9, 2017, 2:30:15 PM10/9/17
to el...@googlegroups.com
Ok, but i want to set the Elmah page without authentication with local access only. I think it is possible.

Atif Aziz

unread,
Oct 9, 2017, 5:02:13 PM10/9/17
to el...@googlegroups.com
So, again, this is more about ASP.NET than ELMAH because what you basically want to do is two have two different authentication schemes for the same web site where one part of the web site is protected by Form authentication and another with local access. There's an easy and a difficult answer.

The easy one is, run two ASP.NET sites with two different authentication configurations. One site will be for your users and require Forms authentication. The other will be for ELMAH and require no authentication but will be locally accessible only. This approach requires no coding.

The difficult one is to write your own authentication module that will react differently depending on the requesting URL. I co-write an article about this many moons ago that you may want to check-out: Supporting HTTP Authentication and Forms Authentication in a Single ASP.NET Web Site.

- Atif 

Rogerio Potenza

unread,
Oct 10, 2017, 6:57:02 AM10/10/17
to el...@googlegroups.com
Ok, Thanks for answering!

Regards, Rogerio.
Reply all
Reply to author
Forward
0 new messages