connection string issue

  • I am hoping someone here can help me.

    For the SQL Server connection strings in my ASP.NET apps  I have to use the SQL Server account and password to connect.    If I try to use the trusted connection, I get an error.

    Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.

    IIS is set up to use a UNC connection.  When I click  "Test Settings" I get the message "The specified user credentials are valid. "

    So why is it seeing  me as NT AUTHORITY\ANONYMOUS instead of that user?  and how do I get my connection strings to work with the trusted connection and not use the SQL Server account?

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

  • Sounds like a double-hop problem.

    Can you post the connection string obfuscated of course just to ensure

    Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=myPassword;

    Server=myServerAddress;Database=myDataBase;Trusted_Connection=True;

     

    If it is the double-hop issue, make sure you have the correct SPN's created at the SQL Server level and have set the account as trusted for delegation so that the kerberos tokens are able to be passed to allow authentication.

     

    Register a Service Principal Name for Kerberos Connections - SQL Server | Microsoft Docs

    https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/register-a-service-principal-name-for-kerberos-connections?view=sql-server-ver16

  • This is what is currently in my web.config

    <add name="DefaultConnection" connectionString="data source=ServerName;Initial Catalog=DatabaseName;user id=myUser;password=myPassword;" providerName="System.Data.SqlClient" />

    This is what I want to use

    <add name="DefaultConnection" connectionString="data source=ServerName;Initial Catalog=DatabaseName;Trusted_Connection=True;" providerName="System.Data.SqlClient" />

    I went to the URL you provided and ran that query in SQL server and it returns NTLM not KERBEROS

     

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply