How to enable Windows Authentication



Greetings, I am trying to use Windows Authentication to control access to my
web app using information from
http://msdn.microsoft.com/en-us/library/ms998358.aspx. I have a very simple
page that has a single login control below. It compiles fine but when I run
it and authenticate with a known good user name and password from my local
machine I get the unhandled exception at the very end. If I remove the
comments from the connection string in the web.config I can authenticate
with using ASP.NET role user. Can someone give me a web.config that would
work in this scenario. I am using Windows 2003 server EE. Thanks in
advance.

Web Page:

<body>
<div>
<form id="form2" runat="server">
<asp:login id="mylogin" FailureText="login failed" runat="server"
Width="100%" OnLoggedIn="mylogin_LoggedIn">
</asp:login>
</form>
</div>
</body>

Web.Config (notice the commented out connection string)

<configuration>
<appSettings/>
<connectionStrings>
<!--<remove name="LocalSqlServer" />
<add name="LocalSqlServer" providerName="System.Data.SqlClient"
connectionString="server=.;database=aspnetdb;Integrated
Security=SSPI"></add>
<add name="LocalSqlServer" connectionString="data
source=.\MSSQLSERVER;Integrated Security=SSPI;AttachDBFilename=aspnetdb;User
Instance=true"
providerName="System.Data.SqlClient" /> -->
</connectionStrings>
<system.web>
<compilation debug="true"/>
<authentication mode="Windows"/>
</system.web>
</configuration>

Unhandled Exception:

An error has occurred while establishing a connection to the server. When
connecting to SQL Server 2005, this failure may be caused by the fact that
under the default settings SQL Server does not allow remote connections.
(provider: SQL Network Interfaces, error: 25 - Connection string is not
valid)


.



Relevant Pages

  • Trusted connections??
    ... I've got an application I want to authenticate to the domain i.e. an ... connection, the system will either use the account that ASP.NET runs under ... this inconsistency odd, which I find odd. ... SQL server use it. ...
    (microsoft.public.dotnet.framework.aspnet)
  • SLEEPING/AWAITING COMMAND question
    ... I am using SQL Server 2000. ... I see a list SPIDs. ... and the connection closed and set to Nothing. ... I see several SPIDs for the user ID that the web app uses to ...
    (comp.databases.ms-sqlserver)
  • Re: ASP.Net with IIS and SQL Server in different hosting companies
    ... Yes, theoretically, you can host SQL Server and your web app far from apart. ... If the communication between the two hosts is via regular internet connection, as you use at home "High-Speed", say, a few Mbp, then your web app would be literally useless. ... The project will basically involve an ASP.Net 2.0 application and a database (ideally MS SQL). ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: intermittent connection problems
    ... If SQL Server can not authenticate the user against the Domain Controller, ... > We are having an intermittent connection problems with some DTS ... > Client network configuration TCP/IP NamePipes ...
    (microsoft.public.sqlserver.connect)
  • Is SQLExpress binaries required on server for forms authentication to work?
    ... I am working on an ASP.NET 2.0 web app that uses forms authentication ... "An error has occurred while establishing a connection to the server. ... When connecting to SQL Server 2005, this failure may be caused by the ...
    (microsoft.public.dotnet.framework.aspnet)

Quantcast