Skip to main content
Participant
December 30, 2008
Question

SQL 2005 database authentication Problem

  • December 30, 2008
  • 3 replies
  • 1129 views
In the past we have used sql user authentication to create the CF datasource for SQL databases, however, we would like to use windows authentication instead, does CF support windows authentication?
    This topic has been closed for replies.

    3 replies

    Charlie Arehart
    Community Expert
    Community Expert
    December 30, 2008
    OK, so in 7.01, you need to upgrade the drivers to get Windows Authentication to work. The drivers that were built-in in 7 were the 3.4 version from Merant/DataDirect. They weren't updated (as a default in the install of CF) until 8,when they were updated to 3.6.

    The 3.5 drivers added Windows authentication, and you can apply them to a CF 7/7.01/7.02 install. Check out my blog entry:

    http://carehart.org/blog/client/index.cfm/2006/8/8/jdbc3.5_update

    If you wonder what version of the drivers you may already be running (in case someone may already have updated the drivers), see this entry:

    http://www.carehart.org/blog/client/index.cfm/2006/8/8/checking_jdbc_driver_version

    Or more simply, just try removing the username/password values in the setup for the SQL Server DSN, to see if it works. If not (and assuming it's not complaining about the CF account username not being an authorized user of the DB), then it seems an update of the drivers is in order. See my first blog entry above for more on what the drivers offer, and why Adobe didn't just update the drivers in the 7 updaters and cumulative hot fixes, so that you must apply the update manually.
    /Charlie (troubleshooter, carehart. org)
    Inspiring
    December 31, 2008
    You could also try using Microsoft's JDBC drivers to support integrated authentication. Note that the ColdFusion Application Server service will need to running as a Windows account with access to your SQL Server.

    See this thread:
    http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=1&catid=6&threadid=1206110&highlight_key=y&keyword1=integrated

    http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?catid=6&threadid=1382972
    Charlie Arehart
    Community Expert
    Community Expert
    December 30, 2008
    Bob, to your question about windows authentication, yes, CF supports it now. May depend on what version you're using, but try just leaving off the username and password entirely when creating a DSN pointing to the SQL Server db. Of course, this means that the account under which CF is running (defaults to System) must be defined in SQL Server to access the database in question. You may find that the System account can, by default. If you've changed the account under which CF runs (typically done in the Windows Services control panel), then you'd need to make sure that account is defined (in SQL Server) to access the database in question.

    Also, your second comment refers to ODBC. Just to be clear, are you talking here about setting up an "ODBC socket" DSN in CF, or are you choosing "Microsoft SQL Server" as the database type in the the Administrator?
    /Charlie (troubleshooter, carehart. org)
    Participant
    December 30, 2008
    Charlie, I am setting up the ODBC connection using SQL Server drive in ODBC data source Administrator and Microsoft SQL Server in CF Administrator. CF version is 7.0.1
    Participant
    December 30, 2008
    Error Message when testing the sql 2005 database data source in Coldfusion Administrator. The windows server ODBC connection to the database tests fine. However, when I attempt to created the CF data source the error below occurs.

    Connection verification failed for data source: Heat
    java.sql.SQLException: [Macromedia][SQLServer JDBC Driver][SQLServer]Login failed for user 'na\svcColdfusion'.
    The root cause was that: java.sql.SQLException: [Macromedia][SQLServer JDBC Driver][SQLServer]Login failed for user 'na\svcColdfusion'.
    Inspiring
    December 30, 2008

    I have read many times in many different discussion lists that the
    *default* security model used by SQL 2005 does not work with the
    ColdFusion SQL server database driver. One has to configure an
    alternate security module in the SQL database management system.

    Sorry I don't use SLQ 2005 and I can not remember the names of these
    security models off the top of my head. But I hope that may be enough
    of a hint to find some of these many discussions that I have read with
    some Google luck.