473,327 Members | 2,012 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,327 software developers and data experts.

Detect if user has authenticated

Hi!

How can Javascript code detect if a user has been authenticated to see
a page, that is, if he has entered a username and password for HTTP
authentification to see the current page. Possibly that can be
determined from the HTTP request header, but how to access this data
for the current page in Javascript?

Plus: how can it detect if the current page is encrypted? Is looking at
the protocol ( https:// ) enough to determine this?

I need it to work in a Firefox extension and why I need this is because
I don't want to process pages that may contain sensitive information.

Thanks,
Uldis

Oct 26 '06 #1
4 3655
ASM
Uldis Bojars a écrit :
How can Javascript code detect if a user has been authenticated to see
a page, that is, if he has entered a username and password for HTTP
authentification to see the current page. Possibly that can be
determined from the HTTP request header, but how to access this data
for the current page in Javascript?

Plus: how can it detect if the current page is encrypted? Is looking at
the protocol ( https:// ) enough to determine this?

I need it to work in a Firefox extension and why I need this is because
I don't want to process pages that may contain sensitive information.
And if visitor disactives its JS, how do you do ?
Or a FF extension can't have JS disactived ?
Oct 26 '06 #2
On Oct 26, 2:49 pm, ASM <stephanemoriaux.NoAd...@wanadoo.fr.invalid>
wrote:
Uldis Bojars a écrit :
How can Javascript code detect if a user has been authenticated to see
a page, that is, if he has entered a username and password for HTTP
authentification to see the current page. Possibly that can be
determined from the HTTP request header, but how to access this data
for the current page in Javascript?
Plus: how can it detect if the current page is encrypted? Is looking at
the protocol ( https:// ) enough to determine this?
I need it to work in a Firefox extension and why I need this is because
I don't want to process pages that may contain sensitive information.
And if visitor disactives its JS, how do you do ?
Or a FF extension can't have JS disactived ?
FF extensions are built on XUL+JavaScript+CSS+...

I assume that you can deactive JavaScript on web pages, but not in FF
extensions.
Because if you did these extensions won't be working at all.
And since Firefox itself is built on XUL nor will it be working with
JavaScript completely cut off.

So the question - how to detect if a user has authenticated and if the
page he is viewing is encrypted - is still open.

Thanks,
Uldis

Oct 26 '06 #3
ASM
Uldis Bojars a écrit :
On Oct 26, 2:49 pm, ASM <stephanemoriaux.NoAd...@wanadoo.fr.invalid>
wrote:
>Uldis Bojars a écrit :
>>How can Javascript code detect if a user has been authenticated to see
a page, that is, if he has entered a username and password for HTTP
authentification to see the current page. Possibly that can be
determined from the HTTP request header, but how to access this data
for the current page in Javascript?
Plus: how can it detect if the current page is encrypted? Is looking at
the protocol ( https:// ) enough to determine this?
I need it to work in a Firefox extension and why I need this is because
I don't want to process pages that may contain sensitive information.
Did you have a look to extension :
Live HTTP Headers
http://livehttpheaders.mozdev.org/
to see or ask how they do ?

(don't know how an extension can stop loading a page)
(don't know how a JS script in a page can get information from an
extension)

cookies ?

--
ASM
Oct 26 '06 #4


On Oct 26, 3:08 pm, ASM <stephanemoriaux.NoAd...@wanadoo.fr.invalid>
wrote:
Uldis Bojars a écrit :
Did you have a look to extension :
Live HTTP Headershttp://livehttpheaders.mozdev.org/
to see or ask how they do ?

(don't know how an extension can stop loading a page)
(don't know how a JS script in a page can get information from an
extension)
Thanks. Looking at LiveHTTPHeaders help - found out that they are
tapping into Mozilla's components to add a listener for HTTP requests
and responses. Should be doable for my extension as well.

Note: I only need to access this information from an extension. No need
to access it from a JS script in a page.
cookies ?
One problem with what I am trying to find out (if a user is in a
password protected page) is that there are many ways to authenticate on
a page and HTTP authentication is not even the most widely used. There
are also session cookies and session IDs in URLs, but these may be
different for each site and detecting all of these would be too much
effort. (An alternative is to forget about detecting password protected
pages and just create a blacklist of pages not to ignore).

What about detecting if the current page/connection is encrypted?
Is the fact that the URL starts with "https://" a good indication of
that?

Thanks,
Uldis

Oct 26 '06 #5

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

Similar topics

0
by: Hans Deragon | last post by:
Greetings. If I want to write a screensaver for Linux using Python, how can I detect that the user has not touched the keyboard or mouse for the last 5 mins? Sincerely, Hans Deragon --
1
by: Derrick | last post by:
I've written a read-only application, reads from tab delimited text files. I want to be able to stick some sort of identification in the text file, so that the app can determine if a user has...
5
by: feng | last post by:
I want to use onunload to capture user's action when he clicks on the "x" button to close the browser. Here is how I do this: <SCRIPT FOR="window" EVENT="onunload"> myScript(); </SCRIPT> ...
7
by: Bredahl jensen | last post by:
Most of the the solution i have seen was throught javascript. Many thanks in advance JB
5
by: Shimon Sim | last post by:
I am working with LogIn control and need to set some property for profile after user is authenticated. I thought that LoggedIn event is the right place but system tells me that the property can't...
0
by: rahul agarwal | last post by:
Hi I want to detect Windows user name when any client browse my webpage. This Webpage has been created in ASP using VBScript as scripting language. I've tried LOGON USER and REMOTE HOST but no...
3
by: shapper | last post by:
Hello, I need to check if a user is authenticated. I tried everything I could think and find: If Membership.ValidateUser("shapper", "27lamps11") Then...
2
by: RP | last post by:
I want to detect user activity (mouse move, key click). For certain critical areas (Form in my app.), I want to check whether there is any user activity for a certain interval. If not, then I want...
18
by: sebastian | last post by:
Can this be done without client-side scripting? I thought sessions might be the answer but after some testing found that sometimes the old session data remained even after the user left the site...
4
by: falbertp | last post by:
Hi, How to detect when user scroll a datagridview it is already reach the end or the most bottom of scroll position? Please answer me, thank you
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.