The DataSourceKey [XXX] is not defined.


Author
Message
Keith Chisarik
Keith Chisarik
StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)
Group: StrataFrame Users
Posts: 939, Visits: 40K
The full error I am getting is:

   An error occurred while creating a new DataLayer for the business object.

   The DataSourceKey [XXX] is not defined.



This error is generated on the call to:

SFSPreferencesBO.RetrieveSecurityPreferences()



Everything works fine* when I don't add a named datasourcekey but leave the default "" :

SecurityBasics.SecurityDataSourceKey = "XXX"



I tried adding this but it didnt help:

DataLayer.DataSources.Add(New SqlDataSourceItem("XXX", "Data Source=IPADDRESS\SQLNAME;Initial Catalog=DBNAME;Integrated Security=True;Persist Security Info=False;Asynchronous Processing=True"))



I have a security project with a security key that matches.



I have my security tables in the same database as my application files, added via the DDT and deployed to the SQL Server.



I am sure I am doing something dumb, as this is the first chance i have had to implement the security module.



Keith



* when I left the SecurityDataSourceKey = "", I could only see the users within my app, when I called up the SecurityDialog from within VS, I saw no users.




Keith Chisarik
Keith Chisarik
Keith Chisarik
StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)
Group: StrataFrame Users
Posts: 939, Visits: 40K
I thought i could plow on just using "", but I cannot add permission sets from within my app (I assume this is intended) and i cant see my "live" users (created from within the SecuritDialog within my app) from within VS.



This also brings me to another question, are security roles then only available for add/edit at design time, that doesn't seem right?

Keith Chisarik
Keith Chisarik
Keith Chisarik
StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)
Group: StrataFrame Users
Posts: 939, Visits: 40K
The above should say "permissions" not "roles" as far as the design time questions.



<< still hoping for an edit capability on ones own posts>>

Keith Chisarik
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
I have my security tables in the same database as my application files, added via the DDT and deployed to the SQL Server.

Then you do not need to set the SecurityDataSourceKey as the security key will reference your application database or default connection.

and i cant see my "live" users (created from within the SecuritDialog within my app) from within VS.

The first question is that did you deploy your users to your application database?  By default this will be empty.  Also, make sure you call the SecurityBasics.SetSecurityKeyAndVectorForUserAuthentication("yourPresharedKey") in the InitApplication otherwise you will not see any user.  In fact, you will get an error.

This also brings me to another question, are security roles then only available for add/edit at design time, that doesn't seem right?

No.  You cannot create permissions as run-time.  This would not make sense since the end-users should not be able to create permissions.  If the end-user created the permissions they would never be implemented within the code (or tested on by you the developer).  They would just be "hollow" permissions that did not do anything.

Keith Chisarik
Keith Chisarik
StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)
Group: StrataFrame Users
Posts: 939, Visits: 40K
Should SFSProjects have been created along with the other security tables in my application database? If yes, then that is the issue, it was not.



If not then I am just lost.



Here is where I am. Everything works fine within my application, I can create users, roles, everything but permissions as stated above by calling the dialog from within my app. I removed the DataSourceKey since you said I didn't need it.



My issue is still this, I cannot see my security data in Visual Studio to add permissions. I figured this is because my connection string points to the Strataframe database (also with security tables), so I changed it (actually added) and new connection to my application database from within the Security Editor.... that is where I got all kinds of errors related to SFSProjects not existing, which it does not in my application database, as created using "add security tables" in the DDT. The "Strataframe" db has 10 security tables, mine has 9.



I either do not understand where/how security projects tie into the security data or I do and the DDT forgot to add one table for some reason so i cant switch to my app database in the Security Editor to work with my apps users/roles/etc.




Keith Chisarik
Keith Chisarik
Keith Chisarik
StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)
Group: StrataFrame Users
Posts: 939, Visits: 40K
OK, I get it.



You have to do everything in the Strataframe database first, then deploy to your application. The deployment wizard "sucks out" the correct related security data (as defined in the security project by the key) and sens it to the application database, from there you can add/modify users and roles but not permissions. Do I have it?



I was doing things right in my target database off the bat.

Keith Chisarik
Keith Chisarik
Keith Chisarik
StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)
Group: StrataFrame Users
Posts: 939, Visits: 40K




close....



the user that was deployed from the package show in my application when I call SecurityDialog, but it says it is corrupt. I am going to wait for some guidance.

Keith Chisarik
Keith Chisarik
Keith Chisarik
StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)
Group: StrataFrame Users
Posts: 939, Visits: 40K
Was driving me nuts, so I dug a little deeper.



Typo on the security key in my security project, so it didn't match the SetSecurityKeyAndVectorForUserAuthentication in Appmain.



All is well, if you can just read the summary above and make sure I now (finally) have the right picture, I would appreciate it.



Blush

Keith Chisarik
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
You have the right picture with the exception of the SFSProjects table.  The SFSProjects should NOT be redeployed as this is used within the design-time aspect of the RBS editor only.  The SFSProjects allows you to create security permissions, users, roles, etc. for different projects or applications.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search