CF10 / SQL Server Windows Authentication

114 views
Skip to first unread message

hofar...@houseoffusion.com

unread,
Feb 11, 2014, 3:43:28 PM2/11/14
to ColdFusion Technical Talk

Hi,
Im having difficulty in creating a datasource to SQL server that has windows authentication setup.
When i create the datasource using the SA account it creates successfully, but when i try and use the windows account i get an error:
'Login failed for user'\domain\username'

i have checked the security options for the server and the user is setup as db_owner and when i try and login using the SQL management studio with the windows details i can login successfully.

it just wont work when creating the datasource.

I have tried using different combinations in the username field:
domain\username
username
username.domain.local
user...@domain.com
uppercase and lowercase

still i get the same error - 'Login failed for user'

any help would be greatly appreciated!

Thanks
Anthony

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:357655

hofar...@houseoffusion.com

unread,
Feb 11, 2014, 3:49:43 PM2/11/14
to ColdFusion Technical Talk

Would you happen to be using MS SQL Express locally? You may need to
adjust your TCP/IP connection settings for SQL, as well as adjust the
systems firewall rules for access. The following post may assist some:

http://www.fusioncube.net/index.php/coldfusion-sql-server-express

Steve 'Cutter' Blades
Adobe Community Professional
Adobe Certified Expert
Advanced Macromedia ColdFusion MX 7 Developer
____________
http://cutterscrossing.com


Co-Author "Learning Ext JS 3.2" Packt Publishing 2010
https://www.packtpub.com/learning-ext-js-3-2-for-building-dynamic-desktop-style-user-interfaces/book

"The best way to predict the future is to help create it"
Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:357656

hofar...@houseoffusion.com

unread,
Feb 11, 2014, 3:58:21 PM2/11/14
to ColdFusion Technical Talk

best method is to use mixed mode and use an sql login from coldfusion dsn.
If you want to use a windows authentication then you need to run coldfusion
under a windows user with authentication on the sql server.
Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:357657

hofar...@houseoffusion.com

unread,
Feb 11, 2014, 4:03:31 PM2/11/14
to ColdFusion Technical Talk

> Im having difficulty in creating a datasource to SQL server that has windows authentication setup.
> When i create the datasource using the SA account it creates successfully, but when i try and use the windows
> account i get an error:
> 'Login failed for user'\domain\username'
>
> i have checked the security options for the server and the user is setup as db_owner and when i try and login using
> the SQL management studio with the windows details i can login successfully.
>
> it just wont work when creating the datasource.
>
> I have tried using different combinations in the username field:
> domain\username
> username
> username.domain.local
> user...@domain.com
> uppercase and lowercase
>
> still i get the same error - 'Login failed for user'

I'll second Russ' recommendation to use mixed mode authentication
instead - it's generally just a lot easier. But if you absolutely,
positively have to use Windows authentication, follow the steps
described here:

http://www.cfuser.com/windows-authentication-sql-server-and-coldfusion/

Dave Watts, CTO, Fig Leaf Software
1-202-527-9569
http://www.figleaf.com/
http://training.figleaf.com/

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
GSA Schedule, and provides the highest caliber vendor-authorized
instruction at our training centers, online, or onsite.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:357658

hofar...@houseoffusion.com

unread,
Feb 11, 2014, 5:50:01 PM2/11/14
to ColdFusion Technical Talk

I would also point out that if you are currently running CF as system, then
you obviously have not locked it down either, so you should consider doing
that.
You should also remember that if you run CF as a domain user who has access
to network resources and all the databases on your sql server, then any
code and any person with access to upload code on your cf server also has
this level of access as well.
Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:357661

hofar...@houseoffusion.com

unread,
Feb 13, 2014, 6:14:23 AM2/13/14
to ColdFusion Technical Talk

Thanks
I'm going to go down with a SQL user and not use the windows authentication.
It wasn't my choice to use more this is what I was given.

Thanks for your help

Sent from my iPhone
Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:357667
Reply all
Reply to author
Forward
0 new messages