Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsAuthenticationAuthentication<identity impersonate="true"> messing up my DB connection messing up my DB connection
Previous
 
Next
New Post
5/9/2008 11:04 AM
 

Hi!

Iam using DNN 4.08.02 with the AD integration installed.
For the AD integration to function I have to add the row:
"<identity impersonate="true" userName="domain\usr" password="pw" />" in web.config.

Sometimes I then get a errormessage accessing my site. When I remove the "identity impersonate" line in web.config the error goes
away (But the AD integration dont work).

The error is:

Cannot open user default database. Login failed.
Login failed for user 'domain\usr'.

[SqlException (0x80131904): Cannot open user default database. Login failed.
Login failed for user 'ds_nt\nh'.]
   System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +435
   System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +82
   System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105
   System.Data.SqlClient.SqlConnection.Open() +111
   Microsoft.ApplicationBlocks.Data.SqlHelperParameterCache.DiscoverSpParameterSet(SqlConnection connection, String spName, Boolean includeReturnValueParameter, Object[] parameterValues) +204
   Microsoft.ApplicationBlocks.Data.SqlHelperParameterCache.GetSpParameterSetInternal(SqlConnection connection, String spName, Boolean includeReturnValueParameter) +303
   Microsoft.ApplicationBlocks.Data.SqlHelperParameterCache.GetSpParameterSet(String connectionString, String spName, Boolean includeReturnValueParameter) +154
   Microsoft.ApplicationBlocks.Data.SqlHelperParameterCache.GetSpParameterSet(String connectionString, String spName) +36
   Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteReader(String connectionString, String spName, Object[] parameterValues) +200
   DotNetNuke.Services.Log.EventLog.DBLoggingProvider.Data.SqlDataProvider.GetLogTypeConfigInfo() +68
   DotNetNuke.Services.Log.EventLog.DBLoggingProvider.DBLoggingProvider.GetLogTypeConfigInfo() +108
   DotNetNuke.Services.Log.EventLog.DBLoggingProvider.DBLoggingProvider.GetLogTypeConfigInfoByKey(String LogTypeKey, String LogTypePortalID) +62
   DotNetNuke.Services.Log.EventLog.DBLoggingProvider.DBLoggingProvider.AddLog(LogInfo objLogInfo) +72
   DotNetNuke.Services.Log.EventLog.LogController.AddLog(LogInfo objLogInfo) +188

I dont realy know exactly what "identity impersonate="true"" does.
1) Do I have to activate this to use the AD integration?
2) Wy is it sometimes messing up my database connection?

Thanks!

 

 

 

 
New Post
5/9/2008 6:05 PM
 

In rough terms (because I only understand this stuff roughly) "identity impersonate="true"" changes the security context under which a process executes.

In your database connection string I'm guessing you've got "Integrated Security=True" and not "User "ID=[user name];Password=[password]"? If you can use the latter option you will connect to the database with a SQL Server login rather than an AD account and you shouldn't have any problems with impersonation.

The right answer to your problem depends on what you are trying to achieve. Getting DNN with the database to operate in a user's context isn't something I'ld try to do without a lot of planning, and more technical knowledge than I've got.

Rhys

 


www.rmjcs.com - Mostly SQL Server Stuff
 
New Post
5/12/2008 2:07 AM
 

Hi!

Thanks for your reply! 
Its correct that Iam using "Integrated Security=True" on my development enviroment where Iam using SQL Server Express. 
I will try using the "User-approach". Is that possible with the SQL Server Express? Yes? :P

Niclas

 
New Post
5/12/2008 7:18 AM
 

SQL Server Express should work fine with SQL Logins. You'll need to create a login in the database first, for example DNNUser, then give this login dbo access to the relevant DNN database. You can do this in SQL Server Management Studio if you have it, or SQL similar to this will do the trick (change the red bits);

USE [master]
GO
CREATE LOGIN [DNNUser] WITH PASSWORD=N'SomeSafePassword', DEFAULT_DATABASE=[master], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF
GO
USE [MyDNNDatabase]
GO
CREATE USER [DNNUser] FOR LOGIN [DNNUser]
GO
USE [MyDNNDatabase]
GO
EXEC sp_addrolemember N'db_owner', N'DNNUser'
GO

Regards, Rhys.


www.rmjcs.com - Mostly SQL Server Stuff
 
New Post
5/12/2008 10:48 AM
 

Hi! Thanks again Rhys!
It all worked fine. Iam now using a SQL instance instead of user instance (If have understod everything correctly) . I haven´t seen the error anymore today, so I belive its all good!

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsAuthenticationAuthentication<identity impersonate="true"> messing up my DB connection messing up my DB connection


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out