CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.security Tags:
Item Type: NewsGroup Date Entered: 11/20/2007 4:04:26 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 4 Views: 18 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
5 Items, 1 Pages 1 |< << Go >> >|
fermar84
Asp.Net User
Problems with authentication using ASP.NET 2.011/20/2007 4:04:26 PM

0/0

Greetings,

This is the scenario: I have a web application developed in ASP.NET with VB.NET. The application will be accesed from both, intranet and extranet. The idea is that if the user is within the intranet the Windows NT account is checked in the DB (the user name which is logged in), otherwise (if the user is not within the intranet) the user is prompted to a login-password page.
So, the problem is getting the Windows NT current user name logged in.

In the web config i have:
    <authentication mode="Windows"/>

Here is what i have tried:

    Dim username1 As String = System.Security.Principal.WindowsIdentity.GetCurrent.Name
    Dim username2 As String = Environment.UserName
    Dim username3 As String = HttpContext.Current.User.Identity.Name
    Dim username4 As String = Request.ServerVariables("AUTH_USER")
    Dim username5 As String = Request.ServerVariables("REMOTE_USER")

The output for the variables is the following:
    In the development enviroment, using Visual Studio 2005 and the ASP.NET Development Server
        username1 = FERNANDO-VM\Fernando
        username2 = Fernando
        username3 = FERNANDO-VM\Fernando
        username4 = FERNANDO-VM\Fernando
        username5 = FERNANDO-VM\Fernando
       
    In the prod environment, using IE and IIS
        username1 = FERNANDO-VM\IUSR_FERNANDO-VM
        username2 = IUSR_FERNANDO-VM
        username3 = (empty)
        username4 = (empty)
        username5 = (empty)

The desired outputs are the ones that shows the development environment, from which i can extract the windows current user name (Fernando).
Do i have a concept error? how could i get the windows user name???

Thank you in advance,
Fernando


Because everything is possible...
wkwork
Asp.Net User
Re: Problems with authentication using ASP.NET 2.011/20/2007 4:25:37 PM

0/0

I know you have to use impersonation on the intranet to get the current user's ID. Just add this line to your web.config under the authentication line:

<identity impersonate="true"/>

As far as how this will react to outside users... I assume it will use the IIS worker process (like it did in your example above) if there's nothing to impersonate. Or just throw an error...

fermar84
Asp.Net User
Re: Problems with authentication using ASP.NET 2.011/20/2007 4:30:43 PM

0/0

First thanks you for answering but that line is already included in the web.config.

Any more ideas?

Fernando 

 


Because everything is possible...
fermar84
Asp.Net User
Re: Problems with authentication using ASP.NET 2.011/20/2007 5:09:09 PM

0/0

i think that the problem is related to some IIS configuration problem. 


Because everything is possible...
tsm
Asp.Net User
Re: Problems with authentication using ASP.NET 2.011/20/2007 10:27:57 PM

0/0

Is anonymous access disabled in IIS?  If anonymous access is enabled in IIS, the request is made using the IUSR_machinename account.  If it is disabled, the request is made using the account of the authenticated user.

5 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Professional ASP.NET 2.0 Security, Membership, and Role Management Authors: Stefan Schackow, Pages: 611, Published: 2006
Pro ASP.NET 2.0 in C# 2005 Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1255, Published: 2005
ASP.NET 2.0 Website Programming: Problem-design-solution Authors: Marco Bellinaso, Pages: 576, Published: 2006
Beginning ASP.NET 2.0 E-commerce in C# 2005: From Novice to Professional Authors: Cristian Darie, Karli Watson, Pages: 681, Published: 2005
ASP.NET 2.0 Cookbook Authors: Michael A. Kittel, Geoffrey T. Leblond, Pages: 989, Published: 2005
Pro ASP.NET 2.0 in VB 2005: From Professional to Expert Authors: Laurence Moroney, Matthew MacDonald, Pages: 1253, Published: 2006
Pro ASP.NET 2.0 Website Programming Authors: Damon Armstrong, Pages: 641, Published: 2005
Professional ASP.NET 2.0 Authors: Bill Evjen, Scott Hanselman, Farhan Muhammad, Srinivasa Sivakumar, Devin Rader, Pages: 1253, Published: 2005
Beginning ASP.NET 2.0 Databases: Beta Preview Authors: John Kauffman, Thiru Thangarathinam, Pages: 427, Published: 2005
Pro ASP.NET 2.0 in C# 2005: Create Next-generation Web Applications with the Latest Version of Microsoft's Revolutionary Technology Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1426, Published: 2006

Web:
Forms Authentication timeout default in ASP.NET 2.0 - ScottGu's Blog NET 2.0. Monday, March 05, 2007 6:21 AM by Terence Watt. Hi Scott,. I'm using ASP.Net 1.1. My website is using Forms Authentication but we set our own ...
ASP.NET 2.0 Membership, Roles, Forms Authentication, and Security ... How To: Connect to SQL Server Using SQL Authentication in ASP.NET 2.0 ...... existing asp.net 2.0 internet app, however I'm hitting problems when attempting ...
How To: Protect Forms Authentication in ASP.NET 2.0 ASP.NET version 2.0 defaults to using SHA1 and AES. ..... For example, if you have a problem with ASP.NET security features, you would use the ASP. ...
Forms authentication using ASP.NET 2.0 and VB.NET This tutorial will show you how to forms authentication using ASP.NET 2.0 and VB .NET. And we only using the default namespace. ...
Implementing Forms Authentication in ASP.Net 2.0 This article will explore the implementation forms authentication using in ASP. Net 2.0.Login Controls and Providers.Allowing Access to certain sections ...
Screen Scraping, ViewState, and Authentication using ASP.Net MasterPages are a great addition to the ASP.NET 2.0 feature set, but are not without their quirks. This article will highlight the common problems ...
Sending SMTP Authenticated E-mail Using ASP.NET 2.0: ASP Alliance Title: Another example on how to send emails using asp.net 2.0 Name: Mr DotNet Date: 12/5/2006 9:15:28 PM Comment: Simple SMTP Authenticated example on how ...
Windows authentication problems using asp.net - Stack Overflow Windows authentication problems using asp.net .... How do you tell IIS 6 to set the .NET version to 2.0 (not 1.1) When New sites are created? ...
ASP.NET 2.0 Membership, Roles, Forms Authentication, and Security ... Mar 25, 2008 ... It walks through how to add Forms Authentication (using the control) ... MSDN: Explained: Forms Authentication in ASP.NET 2.0 ...
Amazon.com: Build Your Own ASP.NET 2.0 Web Site Using C# & VB ... ASP.NET 2.0 Website Programming: Problem - Design - Solution (Programmer to .... NET 2.0 web site using C# or VB.NET, and SQL Server 2005 databases, ...

Videos:
django: Web Development for Perfectionists with Deadlines Google TechTalks April 26, 2006 Jacob Kaplan-Moss ABSTRACT Django is one of the premier web frameworks for Python, and is often compared to Ruby-on...




Search This Site:










any live site written by whidbey?

offtopic javascript que

shared users on all portals

user.identity.isauthenticated

multilanguage - done very easily and powerfull ... ? thank you for some help on this!

.net compiled windows app not running when scheduled

only change content

enumerating indexing service properties

club site slow to start. what dou you think?

duplicate entry after refreshing the page

subroutine not importing text from textbox

insert multiple records from one table to another table

how to save all application errors in a log file?

launching an ms access report

export page to word

portalsecurity.isinrole() problems

databinding, access to datasource

distributing web controls as a part of web setup project

parser error

statement cannot appear within a method body

roles question

more than one wildcard in getfiles

help on scheduler (aspnet_wp.exe unhandled error)

need a few workarounds

db timestamp

horizontal menu control...

second reply to the administrator of the site

3.0.9 issue: portal alias help tooltip

is it possible change all security table names ? such as remove "aspnet_"

post back doesn't work for post method

 
All Times Are GMT