473,416 Members | 1,877 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,416 software developers and data experts.

Capturing Windows Username without popping challenge box in the browser

Hi,
I am currenty working on a site for intranet.
I have a user control in the header of every page that will be
displayed only if people with certain username are surfing the site.
These lists of usernames is stored on the server side in a xml based
file

So what I am doing at the moment is inside the user control pageload
method, i get the username of the current person logged in using
HttpContext.Current.User.Identity.Name and if the username is within
the list of 'allowed-access-usernames', I continue loading the
usercontrol else I set its visibility to false
so they can't see it.

It all works fine if I try to access the site from localhost.
The application grabs my windows username and verfies it against the
list, if i am present in the list, I see the control else I don't

The problem comes when I try to access the site from different machine.
As soon as i try to access the page, IE pops up a window asking for
username and password which I don;t want to.
I want to just grab the username of currenty logged in user on the
machine and give it to the server.

Can anyone help me how do i achieve this?

BTW, I am doing this using windows authentication.
In the IIS 5.1, I have
Anonymous Access unchecked
Integrated Windows Authentication checked

In web.config file
I have windows authentication
and
<identity impersonate="true" />
Thanks,
Raj

Nov 19 '05 #1
8 3931
Hi,

Do you have any <deny/> element under the authorization tag ? It seems that
you are denying users so that IE pops up the window to enter username /
password.

Let me know your Web.config entry.

Joyjit

"Raj Thakkar" <rt******@theage.com.au> wrote in message
news:11**********************@c13g2000cwb.googlegr oups.com...
Hi,
I am currenty working on a site for intranet.
I have a user control in the header of every page that will be
displayed only if people with certain username are surfing the site.
These lists of usernames is stored on the server side in a xml based
file

So what I am doing at the moment is inside the user control pageload
method, i get the username of the current person logged in using
HttpContext.Current.User.Identity.Name and if the username is within
the list of 'allowed-access-usernames', I continue loading the
usercontrol else I set its visibility to false
so they can't see it.

It all works fine if I try to access the site from localhost.
The application grabs my windows username and verfies it against the
list, if i am present in the list, I see the control else I don't

The problem comes when I try to access the site from different machine.
As soon as i try to access the page, IE pops up a window asking for
username and password which I don;t want to.
I want to just grab the username of currenty logged in user on the
machine and give it to the server.

Can anyone help me how do i achieve this?

BTW, I am doing this using windows authentication.
In the IIS 5.1, I have
Anonymous Access unchecked
Integrated Windows Authentication checked

In web.config file
I have windows authentication
and
<identity impersonate="true" />
Thanks,
Raj

Nov 19 '05 #2
Are the users accessing this machine all on the same Windows domain?

Nov 19 '05 #3
Ok..I got it, thats the default behavior for Internet zone security. If you
want a bypass, in IE, Click Tools -> Internet Options -> Security Tab ->
Internet -> Custom Level -> User Authentication -> Automatic logon with
current username and password. But thats a security breach and shouldn't be
practised.

Joyjit

"Joyjit Mukherjee" <jo**************@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Hi,

Do you have any <deny/> element under the authorization tag ? It seems that you are denying users so that IE pops up the window to enter username /
password.

Let me know your Web.config entry.

Joyjit

"Raj Thakkar" <rt******@theage.com.au> wrote in message
news:11**********************@c13g2000cwb.googlegr oups.com...
Hi,
I am currenty working on a site for intranet.
I have a user control in the header of every page that will be
displayed only if people with certain username are surfing the site.
These lists of usernames is stored on the server side in a xml based
file

So what I am doing at the moment is inside the user control pageload
method, i get the username of the current person logged in using
HttpContext.Current.User.Identity.Name and if the username is within
the list of 'allowed-access-usernames', I continue loading the
usercontrol else I set its visibility to false
so they can't see it.

It all works fine if I try to access the site from localhost.
The application grabs my windows username and verfies it against the
list, if i am present in the list, I see the control else I don't

The problem comes when I try to access the site from different machine.
As soon as i try to access the page, IE pops up a window asking for
username and password which I don;t want to.
I want to just grab the username of currenty logged in user on the
machine and give it to the server.

Can anyone help me how do i achieve this?

BTW, I am doing this using windows authentication.
In the IIS 5.1, I have
Anonymous Access unchecked
Integrated Windows Authentication checked

In web.config file
I have windows authentication
and
<identity impersonate="true" />
Thanks,
Raj


Nov 19 '05 #4
Since u have impersonated the USER..(thats good)
But i think u should make sure the computer has ASPNET account!Or add
the computer to this acct!
That process needs to run!
Hope it helps..
Patrick
** is the machine on the same DOMAIN?**
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 19 '05 #5
Raj,
I think the problem is little different and simple. With Impersonation set
to True, you (impersonated account) must have the read access to the xml
file on the IIS server or whereever your xml file is located. To identify
this behavior you can grant yourself read permission to the folder where the
xml file is located but don't grant permission to others. Now only your
should be able to see the user control. If that's the case, you can grant
folder permission to everyone (if that's does not cause harm).

Note: If you don't impersonate make sure the ASPNET account has read access
to the xml file folder.

Hope this help.
Prodip Saha

"Raj Thakkar" <rt******@theage.com.au> wrote in message
news:11**********************@c13g2000cwb.googlegr oups.com...
Hi,
I am currenty working on a site for intranet.
I have a user control in the header of every page that will be
displayed only if people with certain username are surfing the site.
These lists of usernames is stored on the server side in a xml based
file

So what I am doing at the moment is inside the user control pageload
method, i get the username of the current person logged in using
HttpContext.Current.User.Identity.Name and if the username is within
the list of 'allowed-access-usernames', I continue loading the
usercontrol else I set its visibility to false
so they can't see it.

It all works fine if I try to access the site from localhost.
The application grabs my windows username and verfies it against the
list, if i am present in the list, I see the control else I don't

The problem comes when I try to access the site from different machine.
As soon as i try to access the page, IE pops up a window asking for
username and password which I don;t want to.
I want to just grab the username of currenty logged in user on the
machine and give it to the server.

Can anyone help me how do i achieve this?

BTW, I am doing this using windows authentication.
In the IIS 5.1, I have
Anonymous Access unchecked
Integrated Windows Authentication checked

In web.config file
I have windows authentication
and
<identity impersonate="true" />
Thanks,
Raj

Nov 19 '05 #6
Raj,
But is your problem the XML not rendreing to the page or u are being
asked to Authenticate with a LOGIN POPUP....
Because with XML to render u have to put the full path for example
c:\Xmlfiles\Xml\code.xml if u just add code.xml it WON't WORK..unless u
have Anonymous Access..
Patrick


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 19 '05 #7
Thanks alot to everyone for the quick response. I seem to have solved
the problem.

I made a couple of mistakes.

a)
I didn't read the IIS and IE help pages properly.
It clearly stated there that Integrated Windows Authentication wouldnt
work using Proxy Server.

I didn't configure the IE on my Laptop to bypass proxy for intranet. I
was using my laptop to connect to the server. So of course it was going
without by passing the proxy and Integrated Authenication wouldn't work
then.

b)This was really stupid on my part. From my laptop, I wasn't logged in
as the same domain user as the server domain. I was logged in as a user
on the local computer. Really can't believe i overlooked this bit. So
the server kept asking me for username and password because the local
user account cou;dn't be verified under server domain.

I made the necessary changes and it works like a charm.
Thanks everyone again.

Raj

Nov 19 '05 #8
Raj good u solved it!
Enjoy!
Patrick

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 19 '05 #9

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

Similar topics

5
by: Moosebumps | last post by:
I have a large set of Python scripts that interface with command line utilities (primarily Perforce). I am currently capturing ALL the text output in order to get results and such. I am using the...
8
by: Bob Everland | last post by:
I have an application that is ISAPI and the only way to secure it is through NT permissions. I need to have a way to login to windows authentication so that when I get to the ISAPI application no...
33
by: Joerg Schuster | last post by:
Hello, Python regular expressions must not have more than 100 capturing groups. The source code responsible for this reads as follows: # XXX: <fl> get rid of this limitation! if...
14
by: Brent Burkart | last post by:
I am trying to capture the Windows Authenticated username, but I want to be able to capture the login name that exists in IIS, not Windows. In order to enter my company's intranet through the...
2
by: phreeskier | last post by:
i want to implement authorization with windows authentication and don't have the slightest clue of how to do this implementation. the basic windows authentication for this .NET application is...
7
by: lvpaul | last post by:
Hallo ! I am using IIS-Windows-Authentication in my intranet (web.config <authentication mode="Windows" /> <identity impersonate="true" /> How can I get the users (client) IP-Address ? I...
4
by: James | last post by:
I have a VB windows forms application that accesses a Microsoft Access database that has been secured using user-level security. The application is being deployed using No-Touch deployment. The...
8
by: Bruno Barros | last post by:
Hey there. I'm currently working on an intranet, and would like to know how I can get the windows usernames of the visitors. You can get their IP with $_SERVER; But what about their Windows...
2
by: zanzibar | last post by:
I need to develop an intranet app that uses Windows Authentication with IIS set up for Windows Integrated Authentication. The problem is that I want to force a challenge (i.e., force the user to...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.