How to access currently logged in user from Active Directory. (Without custom login page)

A

anonymous

Hi all,

I've been searching the way to achieve the following task.
But no luck so far.

I have a web site(main site), which requires authentication. This
authentication is set at Windows directory level, so user will see the
pop up gray box in order to log in rather than custom web page. The
username and password are stored at active directory level, thus this is
the windows integrated security.

Now, I have created another web site under same security setting. So
once user logged into the main web site and click on the link to this
second web site, they can view the site without additional login.

Here is what I need. I need to read in currently logged in user from
the second web site, since this is something I will be storing in my
database as well as use it to determine certain business logics.

One obvious work around is to creat custom login page to Active
Directory, and store the logged in userid in session variable as I
authenticate. Unfortunately, this is not what I want to do. Because I
have no control over the main web site. So if I take this approach,
user must login twice in order to user my site. First login to main
site, then when they click on the link to my site, type in the same
login userid and password to view my site.

I'm hoping to see some simple solution such as Session["CurrentUserID"]
variable.. (if there is one..)

Please help!

Thanks

Takashi
 
A

Arild Bakken

I don't think you'll get an easy answer to this. If these are two separate
websites (even if on the same server) then the context the code is running
under is different, and the Session objects will be completely separated. In
addition, IE will see them as two separate sites, and will require separate
logins (as long as your using integrated security)

If you want to keep the current session and stay with one login, you'll have
to add you new webapp to the same site/application as the first one by
creating a virtual directory under the existing site.


Arild
 

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

Top