ASP.NET Windows Authentication Problems
From: Phil Pragnell, IT Developer (philip.pragnell@electricity.gg)
Date: 10/08/02
- Next message: Paul Clement: "Re: ASP.NET Windows Authentication Problems"
- Previous message: Willy Denoyette [MVP]: "Re: Using System.DirectoryServices by a Web Services"
- Next in thread: Paul Clement: "Re: ASP.NET Windows Authentication Problems"
- Reply: Paul Clement: "Re: ASP.NET Windows Authentication Problems"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
From: philip.pragnell@electricity.gg (Phil Pragnell, IT Developer) Date: 8 Oct 2002 08:51:41 -0700
I wish to access a SQL Server database using Windows Authentication
from an ASP.NET application. I have the following settings in my
web.config file:
<authentication mode="Windows"></authentication>
<identity impersonate="false"></identity>
In an attempt to understand the problem I've used the following code
on the WebForm:
Dim wp As New System.Security.Principal.WindowsPrincipal(System.Security.Principal.WindowsIdentity.GetCurrent())
Dim username As String = wp.Identity.Name
Response.Write("wp identity is " & username)
Response.Write("<BR>User Identity is " & User.Identity.Name.ToString)
This code outputs the following on the page:
wp identity is myserver\ASPNET
User Identity is mydomain\myaccountname
In IIS on the development server I only have Integrated Windows
Authentication. Anonymous access it not set.
HOWEVER when I attempt to access the SQL database I get the following
error:
"Login failed for user '(null)'. Reason: Not associated with a trusted
SQL Server connection."
I've had a look on Google Groups. A lot of people seem to
experiencing similar problems, but I've yet to find any solutions.
Any help would be greatly appreciated.
Thanks,
- Next message: Paul Clement: "Re: ASP.NET Windows Authentication Problems"
- Previous message: Willy Denoyette [MVP]: "Re: Using System.DirectoryServices by a Web Services"
- Next in thread: Paul Clement: "Re: ASP.NET Windows Authentication Problems"
- Reply: Paul Clement: "Re: ASP.NET Windows Authentication Problems"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|