Re: Help to Get User Name And their roles ! Urgent
From: rama (ramakrishnam@indosoft.stph.net)
Date: 04/25/03
- Next message: rama: "reg: getting user name in asp.net"
- Previous message: Mike Moore [MSFT]: "RE: UNC file share and NTLM user identity"
- In reply to: szabelin: "Reg: Help to Get User Name And their roles ! Urgent"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
From: "rama" <ramakrishnam@indosoft.stph.net> Date: Fri, 25 Apr 2003 11:10:16 +0530
Hi All:
Thanx for ur suggestions. This is my code. Iam getting user name and domain
also. But iam not getting
the user name which i entered when iam autheticated thorugh IIS, after
setting Integrated Windown
Authentication on. For eg: Iam in groupware domain and the user name is
rama...So i should get user
name as rama, but iam getting user name as SYSTEM.From where it's getting
the user name as
SYSTEM.WHY is it so? Please help me out to get rid of this problem.
<%@ Import Namespace="System.Security.Principal" %>
<html>
<script runat="server">
sub Page_Load(o as object, e as eventargs)
dim uns
'uns=User.Identity.Name
uns=CType(User.Identity,WindowsIdentity)
dim uns1
uns1=uns.GetCurrent()
response.write(uns1.Name)
dim str1() as string
str1=Microsoft.VisualBasic.Split(uns1.Name,"\")
response.write(str1(1))
response.write(uns1.IsAuthenticated)
response.write(User.IsInRole("BUILTIN\Adminitrators"))
end sub
</script>
</html>
****** Iam getting the output as follows:
NT AUTHORITY\SYSTEM
SYSTEM
True
False
**********************************
Thanx In Advance
Rama Krishna.M
"szabelin" <szabelin@cal.berkeley.edu> wrote in message
news:05bf01c30a93$0beae6c0$2f01280a@phx.gbl...
>
> Hi try going to your IIS -> right click on your folder ->
> Properties -> Directory Security -> Edit
>
> And set Integrated Windows Authentication to ON
>
> I did that in my case and I get IIdentity object set with
> user name and so on
>
> Hope this helps you too
> Sergey
>
>
>
> >-----Original Message-----
> >Hi All:
> >
> >Iam unable to get the user name and their active role in
> a web form from
> >asp.net. I have used user.identity.name to get the user
> name. Iam using
> >Vb.net as a language in asp.net. But nothing is displayed
> by using the
> >mentioned property. Actually what i need is, i want to
> know the user name
> >who had enter into my site, and his/ her pariticular role
> through windows
> >authentication. If i know the
> >role and user name, then accordingly, i'll restrict the
> forms to show to
> >that particualr user according to their priveleges. Iam
> using Win-2000
> >Server as OS. Could anyone come across
> >this problem. Please help me out.
> >
> >Thanx in advance
> >
> >Best Regards
> >Rama Krishna.M
> >
> >
> >.
> >
- Next message: rama: "reg: getting user name in asp.net"
- Previous message: Mike Moore [MSFT]: "RE: UNC file share and NTLM user identity"
- In reply to: szabelin: "Reg: Help to Get User Name And their roles ! Urgent"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|
|