User information in the web request

V

Vadym Stetsyak

Hi there!
Is it possible to retieve user nt name from the web request? This question
arose while thinking about authentication system implementation in the
asp.net.

I want to make authentication process transparent for the user. E.g. if the
user is logged on the domain or is a member of the domain then perform
authentication autimatically - as a result user won't experience any login
windows, otherwise web-app will provide the form similar the IIS one for
authentication.

Can this be done from the web application?

TIA
 
G

Guest

You can tell who the user is once they are logged into the app, but you will
get IUSR_ComputerName or NetworkSystem prior to this point, as web apps are
anon by default.

There are ways to set up IE on an Intranet to avoid the login. An even
better option is issuing user certs, as the user can work from any computer
he has a cert without having to worry about login.


---

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
 
V

Vadym Stetsyak

Thanks for the answer, I know about these ways, just wondered if it can be
completed in the other way
 
G

Guest

Hi Vadym,

If you use windows authentication and deny anonymous access:
In web.config
<authentication mode="Windows" />
<authorization>
<deny users="?" />
<allow users="*" />
</authorization>

Then you can use
Context.User.Identity.Name

to get Domain/userID.

And use

Context.User.IsInRole(strRole)

to perform role checking.

HTH

Elton Wang
(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top