0

I have a site that uses elmah, that is currently Windows auth, that I am going to be switching over to single sign-on using OIDC.

This site is using .NET Framework.

I want the elmah page (elmah.axd) to be accessible remotely, but to be secured so only developers can access it. This is currently set up in the web.config, like so:

<elmah>
  <security allowRemoteAccess="true" />
  <errorLog type="Elmah.SqlErrorLog, Elmah" connectionStringName="ElmahLog" />
</elmah>
 
<location path="elmah.axd" inheritInChildApplications="false">
  <system.web>
    <httpHandlers>
      <add verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" />
    </httpHandlers>
    <authorization>
      <allow roles="[Domain]\[Developers AD Group]" />
      <deny users="*" />
    </authorization>
  </system.web>
  <system.webServer>
    <handlers>
      <add name="ELMAH" verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" preCondition="integratedMode" />
    </handlers>
  </system.webServer>
</location>

Is it possible to accomplish the same thing with SSO? If possible, I want to avoid specifying individual users who can access the elmah pages.

3
  • If you want to integrate with the ye olde and busted WebForms-era "Role" system then you'll likely need to write your own RoleProvider that integrates with your OIDC client (if one doesn't exist already; I don't know: I haven't checked). Commented Dec 16 at 2:05
  • 1
    ...but at this point, I recommend you instead first modernize your application by migrating from WebForms + aspx/asmx/axd to ASP.NET MVC + WebAPI, then to ASP.NET Core, because that comes with OIDC support built-in (and far better logging features than Elmah too, IMO). Commented Dec 16 at 2:06
  • Thanks! We are on MVC at least, but this one will be a bit before we can migrate to newer .NET stuff. Looks like I'll have to look into a custom RoleProvider. Commented Dec 16 at 16:38

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.