+ Reply to Thread
Results 1 to 8 of 8
-
06-16-2008 11:03 AM #1rgenter Guest
Adding thousands of respondents to the database
I am integrating Checkbox into our recipient communication platform. As part of this integration I need to be able to add thousands of users at a time to the Checkbox database and be able to extract their responses.
I've pretty much figured out how to do everything such as populating the ckbx_Credential and ckbx_CustomUserFieldMap tables and pulling data from the ckbx_ResponseAnswers and ckbx_Response tables (including using ckbx_ItemOptions and ckbx_Text). What I'm missing is how to limit the users to their specific survey.
It appears that I need to have a separate record in ckbx_AccessControlEntry for each respondent, plus a corresponding entry in ckbx_AccessControlEntries to map the respondent to the appropriate access control list. What I haven't been able to find is how to identify which access control list to use. How do I know which list enables the respondent for which survey?
Rick Genter
Silverlink Communications
-
06-16-2008 11:39 AM #2
Administrator
- Join Date
- Mar 2007
- Posts
- 385
It sounds like you have a pretty good handle on things. One possible variation would be to add your users to user groups; in this scenario you would only need to manage the group's ACL.
The ckbx_Template.AclID column maps a template to an ACL. I'm not sure what information you are using to identify your ResponseTemplate but if it is something other than the ID, ckbx_Template and ckbx_ResponseTemplate are related on the TemplateID and ResponseTemplateID columns.
-
06-17-2008 07:58 PM #3rgenter Guest
Encrypted passwords?
Thanks for your reply.
I have this mostly working, except that I can't get encrypted passwords to work. My understanding is that when a password is encrypted its MD5 hash should be stored in the database. I've tried storing both
HASHBYTES('MD5', password)
(which is a VARBINARY cast to VARCHAR) and an ASCII representation of the resulting binary string. In other words, I've tried both the equivalent of
CAST(0x123456789A.... AS VARCHAR(32))
and
'123456789A.....'
Neither of these worked. How should I store a password such that I can set Encrypted to 1 and have it work?
-
06-18-2008 11:11 AM #4
Administrator
- Join Date
- Mar 2007
- Posts
- 385
I do not believe it will be possible to generate an encrypted password in sql. If it is a requirement that you encrypt the passwords it would be our suggestion to use either the direct API or the user management web service to create users.
-
06-18-2008 11:14 AM #5rgenter Guest
Unfortunately neither of those solutions is acceptable, as both would require adding users one at a time, and that's not practical when adding thousands of users.
What is the algorithm used to encrypt the password? I was originally told that it was an MD5 hash, but apparently that's not the case.
-
06-18-2008 02:11 PM #6
Administrator
- Join Date
- Mar 2007
- Posts
- 385
Certainly a bulk SQL insert will be faster than using either the webservice or the direct API but both of these options are pretty fast. How many user accounts are you trying to create and how frequently will you be creating them?
As a data point, I was able to create 10,000 user accounts in 2 minutes and 17 seconds using the webservice; admittedly my test was pretty basic.
Do you remember who you spoke to about creating encrypted passwords directly in the database?
-
06-18-2008 02:22 PM #7rgenter Guest
A typical batch may be anywhere from a few thousand to a few hundred thousand. We'll probably be creating these on a weekly basis.
We would really prefer to be able to do this from SQL, as it can then be integrated into our overall workflow management system.
It was John Fischer:
"One of my developers familiar with the way that Checkbox does encryption says that Checkbox uses an MD5 Hash with no Salt."
-
06-18-2008 06:39 PM #8
Administrator
- Join Date
- Mar 2007
- Posts
- 385
I spoke with John and it appears there was a miscomunication. The developer he spoke to was unaware that your ultimate goal was to replicate this logic in SQL. It is true that user passwords are hashed using MD5 and that no salt is used. Additionally the hash is ASCII encoded. In .NET the ASCII encoding process drops the most signifciant bit of characters which are none standard ASCII.


LinkBack URL
About LinkBacks
Reply With Quote

