473,406 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Custom html-protection of HTML-files

Hi

I face this challenge:

An existing site with 50000+ html-files needs to be protected by a custom
login-system which has two goals:

1. Protect HTML-content (authentication required)
2. If the same username is used by two persons at the same time, they have
to be logged out (when a login is used, other users currently logged in
using the same login need to be logged out).

It is not an option to modify the html-files.

I enabled forms authentication, and created login-code. This works great. I
also made sure asp.net processes html-files, so unauthenticated users are
sent to the login-screen. So far so good.

As for goal two, logging people using same login out, it's a bit more
challenging.

When a user (User A) logs in, I give the user a custom session-id, which I
store in the database and in a session-variable. If a new user logs in using
the same credentials (User B) , the session of the User A expires in the
database. The next time User A requests a page, I need to log User A out.

I have managed to get that working for .aspx-files using global.asax and the
Application_PreRequestHandlerExecute-sub (context.session is not available
in Application_BeginRequest). I use the section to check in a db if the
session is still valid - and if not I redirect to the login-page.

This section Application_PreRequestHandlerExecute also fires for a user who
requests a html-file, but the context.session object is not available. I get
an error that Context.session is nothing. It is however available when the
user requests a .aspx-file. That means I can't get a hold of the
session-variable I need, in order to check the users status in the db (if
the session is still valid).

How can I work around this? Other ideas are also welcome.

I know this is a bit complicated to explain, I hope I managed to get the
message through. :)
Thanks in advance

- Klaus
Oct 27 '06 #1
1 1251
number 1 is easy, iis will doit or if you want forms authenication map file
to asp.net.

number 2 is difficult unless you control the infrastructure (say its a local
lan). if you will allow the user only one browser session at time (they can
not open your site with two browser windows n the same computer), then you
can tie a session cookie to a login.

-- bruce (sqlwork.com)

"Klaus Jensen" <sp******@burninhell.comwrote in message
news:eb****************@TK2MSFTNGP05.phx.gbl...
Hi

I face this challenge:

An existing site with 50000+ html-files needs to be protected by a custom
login-system which has two goals:

1. Protect HTML-content (authentication required)
2. If the same username is used by two persons at the same time, they have
to be logged out (when a login is used, other users currently logged in
using the same login need to be logged out).

It is not an option to modify the html-files.

I enabled forms authentication, and created login-code. This works great.
I also made sure asp.net processes html-files, so unauthenticated users
are sent to the login-screen. So far so good.

As for goal two, logging people using same login out, it's a bit more
challenging.

When a user (User A) logs in, I give the user a custom session-id, which I
store in the database and in a session-variable. If a new user logs in
using the same credentials (User B) , the session of the User A expires in
the database. The next time User A requests a page, I need to log User A
out.

I have managed to get that working for .aspx-files using global.asax and
the Application_PreRequestHandlerExecute-sub (context.session is not
available in Application_BeginRequest). I use the section to check in a db
if the session is still valid - and if not I redirect to the login-page.

This section Application_PreRequestHandlerExecute also fires for a user
who requests a html-file, but the context.session object is not available.
I get an error that Context.session is nothing. It is however available
when the user requests a .aspx-file. That means I can't get a hold of the
session-variable I need, in order to check the users status in the db (if
the session is still valid).

How can I work around this? Other ideas are also welcome.

I know this is a bit complicated to explain, I hope I managed to get the
message through. :)
Thanks in advance

- Klaus

Oct 27 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: rizwanahmed24 | last post by:
Hello i have made a custom control. i have placed a panel on it. I want this panel to behave just like the normal panel. The problem i was having is that the panel on my custom control doesnt...
2
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
1
by: asharda | last post by:
I have a custom property grid. I am using custom property grid as I do not want the error messages that the propertygrid shows when abphabets are entered in interger fields. The custom property...
0
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.