How to get logged in user from another app?

J

John Dalberg

I have an Intranet asp.net application that opens multiple frames in its
main page. Authentication to the Intranet app is forms based. The app is
third party closed source. One of the frames can display other apps which I
develop. What I want to do is I don't want any user access my apps from
outside the Intranet and I want to be able from inside my app to find out
who is the current user.

I can get the Intranet use sql server as a state server and it can save the
current user in a database. However in *my* application, how can I
determine the current Intranet user for the client that sent a request to
access my app? It seems the solution is simple and out there but I can't
get my hands on it.

Is there a way to have my apps and the Intranet app share the same session
without me having the source code for the Intranet app?

TIA.
 
E

Elton Wang

Hi John,

For Intranet, If you use windows authentication and deny
anonymous access:
<authentication mode="Windows"/>
<authorization>
<deny users="?" /> <!-- deny anonymous -->
<allow users="*" /> <!-- Allow all users -->
</authorization>

You can use

Page.User.Identity.Name
Page.User.IsInRole

to find out authentication user and determine user's role
without user logging in process.

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,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top