|
|
|
start date: Mon, 23 Jul 2007 07:34:03 -0700,
posted on: microsoft.public.dotnet.framework.aspnet.security
back
| Thread Index |
|
1
Herb am
|
|
2
Dominick Baier
|
|
3
Herb am
|
|
4
Dominick Baier
|
|
5
Herb am
|
|
6
Dominick Baier
|
How to find Current User Name
When I run my ASP.NET application from my development PC,
Me.User.Identity.Name works. When I run it from my Intranet site, it does
not. Any suggestions?
Date:Mon, 23 Jul 2007 07:34:03 -0700
Author:
|
Re: How to find Current User Name
Use
Context.User.Identity.Name
-----
Dominick Baier (http://www.leastprivilege.com)
Developing More Secure Microsoft ASP.NET 2.0 Applications (http://www.microsoft.com/mspress/books/9989.asp)
> When I run my ASP.NET application from my development PC,
> Me.User.Identity.Name works. When I run it from my Intranet site, it
> does not. Any suggestions?
>
Date:Mon, 23 Jul 2007 15:02:21 +0000 (UTC)
Author:
|
Re: How to find Current User Name
No luck. This yields a blank string.
These are my three lines of code:
Response.Write(">" & Me.User.Identity.Name & "<<BR>")
Response.Write(">" & System.Security.Principal.WindowsIdentity.
GetCurrent().Name & "<<BR>")
Response.Write(">" & Context.User.Identity.Name & "<")
When run locally yields:
>DOMAIN\USERNAME<
>DOMAIN\USERNAME<
>DOMAIN\USERNAME<
When run on the Intranet yields:
><
>WEBSERVERNAME\ASPNET<
><
From
"Dominick Baier" wrote:
> Use
>
> Context.User.Identity.Name
>
>
> -----
> Dominick Baier (http://www.leastprivilege.com)
>
> Developing More Secure Microsoft ASP.NET 2.0 Applications (http://www.microsoft.com/mspress/books/9989.asp)
>
> > When I run my ASP.NET application from my development PC,
> > Me.User.Identity.Name works. When I run it from my Intranet site, it
> > does not. Any suggestions?
> >
>
>
>
Date:Mon, 23 Jul 2007 08:18:04 -0700
Author:
|
Re: How to find Current User Name
Then i guess you have'nt disabled anonymous auth on your intranet server
(in IIS)...
-----
Dominick Baier (http://www.leastprivilege.com)
Developing More Secure Microsoft ASP.NET 2.0 Applications (http://www.microsoft.com/mspress/books/9989.asp)
> No luck. This yields a blank string.
> These are my three lines of code:
> Response.Write(">" & Me.User.Identity.Name & "<<BR>")
> Response.Write(">" & System.Security.Principal.WindowsIdentity.
> GetCurrent().Name & "<<BR>")
> Response.Write(">" & Context.User.Identity.Name & "<")
> When run locally yields:
>
>> DOMAIN\USERNAME<
>> DOMAIN\USERNAME<
>> DOMAIN\USERNAME<
> When run on the Intranet yields:
>
>> <
>> WEBSERVERNAME\ASPNET<
>> <
> From
>
> "Dominick Baier" wrote:
>
>> Use
>>
>> Context.User.Identity.Name
>>
>> -----
>> Dominick Baier (http://www.leastprivilege.com)
>> Developing More Secure Microsoft ASP.NET 2.0 Applications
>> (http://www.microsoft.com/mspress/books/9989.asp)
>>
>>> When I run my ASP.NET application from my development PC,
>>> Me.User.Identity.Name works. When I run it from my Intranet site, it
>>> does not. Any suggestions?
>>>
Date:Mon, 23 Jul 2007 15:58:14 +0000 (UTC)
Author:
|
Re: How to find Current User Name
oops! it's always the simple things, isn't it? Incidentally,
Me.User.Identity.Name also works. Is there a preferred method?
"Dominick Baier" wrote:
> Then i guess you have'nt disabled anonymous auth on your intranet server
> (in IIS)...
> -----
> Dominick Baier (http://www.leastprivilege.com)
>
> Developing More Secure Microsoft ASP.NET 2.0 Applications (http://www.microsoft.com/mspress/books/9989.asp)
>
> > No luck. This yields a blank string.
> > These are my three lines of code:
> > Response.Write(">" & Me.User.Identity.Name & "<<BR>")
> > Response.Write(">" & System.Security.Principal.WindowsIdentity.
> > GetCurrent().Name & "<<BR>")
> > Response.Write(">" & Context.User.Identity.Name & "<")
> > When run locally yields:
> >
> >> DOMAIN\USERNAME<
> >> DOMAIN\USERNAME<
> >> DOMAIN\USERNAME<
> > When run on the Intranet yields:
> >
> >> <
> >> WEBSERVERNAME\ASPNET<
> >> <
> > From
> >
> > "Dominick Baier" wrote:
> >
> >> Use
> >>
> >> Context.User.Identity.Name
> >>
> >> -----
> >> Dominick Baier (http://www.leastprivilege.com)
> >> Developing More Secure Microsoft ASP.NET 2.0 Applications
> >> (http://www.microsoft.com/mspress/books/9989.asp)
> >>
> >>> When I run my ASP.NET application from my development PC,
> >>> Me.User.Identity.Name works. When I run it from my Intranet site, it
> >>> does not. Any suggestions?
> >>>
>
>
>
Date:Mon, 23 Jul 2007 10:16:00 -0700
Author:
|
Re: How to find Current User Name
Me implies that you are on a page - Context works everywhere...
-----
Dominick Baier (http://www.leastprivilege.com)
Developing More Secure Microsoft ASP.NET 2.0 Applications (http://www.microsoft.com/mspress/books/9989.asp)
> oops! it's always the simple things, isn't it? Incidentally,
> Me.User.Identity.Name also works. Is there a preferred method?
>
> "Dominick Baier" wrote:
>
>> Then i guess you have'nt disabled anonymous auth on your intranet
>> server
>> (in IIS)...
>> -----
>> Dominick Baier (http://www.leastprivilege.com)
>> Developing More Secure Microsoft ASP.NET 2.0 Applications
>> (http://www.microsoft.com/mspress/books/9989.asp)
>>
>>> No luck. This yields a blank string.
>>> These are my three lines of code:
>>> Response.Write(">" & Me.User.Identity.Name & "<<BR>")
>>> Response.Write(">" & System.Security.Principal.WindowsIdentity.
>>> GetCurrent().Name & "<<BR>")
>>> Response.Write(">" & Context.User.Identity.Name & "<")
>>> When run locally yields:
>>>> DOMAIN\USERNAME<
>>>> DOMAIN\USERNAME<
>>>> DOMAIN\USERNAME<
>>> When run on the Intranet yields:
>>>
>>>> <
>>>> WEBSERVERNAME\ASPNET<
>>>> <
>>> From
>>>
>>> "Dominick Baier" wrote:
>>>
>>>> Use
>>>>
>>>> Context.User.Identity.Name
>>>>
>>>> -----
>>>> Dominick Baier (http://www.leastprivilege.com)
>>>> Developing More Secure Microsoft ASP.NET 2.0 Applications
>>>> (http://www.microsoft.com/mspress/books/9989.asp)
>>>>> When I run my ASP.NET application from my development PC,
>>>>> Me.User.Identity.Name works. When I run it from my Intranet site,
>>>>> it does not. Any suggestions?
>>>>>
Date:Mon, 23 Jul 2007 17:22:26 +0000 (UTC)
Author:
|
|
|