Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. IHttpModule Custom Authentication

IHttpModule Custom Authentication

Scheduled Pinned Locked Moved ASP.NET
securityquestion
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    Fayu
    wrote on last edited by
    #1

    Hi, I have created a Authentication Class which implements IHttpModule. When it comes to checking to see if the user is authenticated, this class works fine. However, there are some pages that do not require authentication. These are the files that I have: SecurePage.cs - Inherits from Page with a 'IsSecure' property secure.aspx - can only be accessed by authenticated user public.aspx - can be viewed by anyone login.aspx - page where users are redirected to if they try to access secure.aspx and they are not logged in Is it possible to find out what type of page is being accessed via the Custom HttpModule? Thanks in advance.

    F 1 Reply Last reply
    0
    • F Fayu

      Hi, I have created a Authentication Class which implements IHttpModule. When it comes to checking to see if the user is authenticated, this class works fine. However, there are some pages that do not require authentication. These are the files that I have: SecurePage.cs - Inherits from Page with a 'IsSecure' property secure.aspx - can only be accessed by authenticated user public.aspx - can be viewed by anyone login.aspx - page where users are redirected to if they try to access secure.aspx and they are not logged in Is it possible to find out what type of page is being accessed via the Custom HttpModule? Thanks in advance.

      F Offline
      F Offline
      Fayu
      wrote on last edited by
      #2

      I found that the HttpApplicaion.Context.Handler (type of IHttpHandler) is created before the AcquireRequestState event. The Handler contains all the info that I require. So by subscribing to this event allows you to access the page which is calling the Authentication class. Hopefully this helps someone in the future.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups