RE: Windows authentication from ASP.NET to SQL Server



The easiest way is to turn off anonymous access for the Intranet site. This
will force authentication, usually through a login box (although the network
admins can alleviate this through policy).

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************


"Nils Magnus Englund" wrote:

> Hello,
>
> I am having trouble using Integrated Windows Authentication between our
> intranet server and our database server, both of which are on our local
> domain.
>
> Windows authentication works for our intranet server - my domain user
> "DOM\nme" is correctly authenticated and authorized to view the ASP.NET page
> on our intranet. The ASP.NET application uses impersonation (<identity
> impersonate="true"> in Web.config).
>
> Windows authentication also works for the SQL Server; when logged on to the
> domain, I can start Query Analyzer and connect to the SQL Server using
> Windows authentication. Permissions on the SQL Server are also correctly set
> up.
>
> However, problems arise when I want to connect to the SQL Server from the
> ASP.NET page - I get the fairly common error message below:
>
> Login failed for user '(null)'. Reason: Not associated with a trusted SQL
> Server connection.
>
> Although I do get a lot of hits when searching for this specific error, I
> still can't seem to find the cause of the problem.
>
> The connection string I'm using to connect to the SQL Server is:
> "Server=DB;Integrated Security=SSPI;Database=IntranetDB".
>
> When setting <identity impersonate="false">, I get the error message "Login
> failed for user 'DOM\INTRANET$'." - DOM\INTRANET$ is the hostname of the
> intranet server.
>
> In the database servers event log, I can see two events (supplied below)
> after trying to authenticate (unsuccessfully) from the ASP.NET application
> to the SQL Server as "DOM\nme".
>
> What do I need to do to let users use Windows authentication against the DB
> server as well?
>
>
> Regards,
> Nils Magnus Englund
>
>
> (event log entries follows...)
>
>
> Date: 08.08.2005
> Source: Security
> Time: 15:14:55
> Category: Logon/Logoff
> Type: Success Audit
> Event ID: 540
> User: NT AUTHORITY\ANONYMOUS LOGON
> Computer: DB
>
> Description:
> Successful Network Logon:
> User Name:
> Domain:
> Logon ID: (0x0,0x5CE408)
> Logon Type: 3
> Logon Process: NtLmSsp
> Authentication Package: NTLM
> Workstation Name: INTRANET
> Logon GUID: -
> Caller User Name: -
> Caller Domain: -
> Caller Logon ID: -
> Caller Process ID: -
> Transited Services: -
> Source Network Address: -
> Source Port: -
>
>
> Date: 08.08.2005
> Source: Security
> Time: 15:14:55
> Category: Logon/Logoff
> Type: Success Audit
> Event ID: 538
> User: NT AUTHORITY\ANONYMOUS LOGON
> Computer: DB
>
> Description:
> User Logoff:
> User Name: ANONYMOUS LOGON
> Domain: NT AUTHORITY
> Logon ID: (0x0,0x5CE408)
> Logon Type: 3
>
>
>
>
>
>
>
>
.



Relevant Pages

  • Re: Kerberos machine authentication - apparent authentication fail
    ... > until logon), the wireless connection can kick off when it is ready. ... > was confirmed in the server event logs with IAS (i set that up as the radius ... > as an ordinary user kicks in and takes over from the machine authentication. ... > while the network sorts itself out and a double click on a network link of ...
    (microsoft.public.windows.server.security)
  • Re: Constant Password Authentication
    ... domain and server name in the URL. ... confirm that the same authentication methods are checkmarked as compared to ... Within our organisation there are staff who are ... > Up until recently a company that has had access to our intranet had been ...
    (microsoft.public.inetserver.iis.security)
  • Kerberos authentication
    ... TCP 1600 and 1601 are the ports we have limited RPC traffic to according to ... The following traffic is allowed to the File Server ... The failure code from authentication protocol Kerberos ... was "There are currently no logon servers available to service the logon ...
    (microsoft.public.windows.server.active_directory)
  • Re: Event log shows NTLM not Kerberos
    ... I found the following Authentication security log in your log file: ... "Successful Network Logon: ... How to force Kerberos to use TCP instead of UDP in Windows Server ... I would like introduce how Windows system works for resource ...
    (microsoft.public.security)
  • Re: Event log shows NTLM not Kerberos
    ... |> I found the following Authentication security log in your log file: ... |> "Successful Network Logon: ... When a client attempts to access a resource on the server, ...
    (microsoft.public.security)