ColdFusion Security
This is a very good tutorial. It explains everything in a great amount of detail.
Thnx
Posted by: Artak
Posted on: 06/17/2004 01:58 AM
|
I tried to setup the downloadable files in my machine, But realy I am confuse How I begin and what is the starting point please help me!
Posted by: Mohsena
Posted on: 06/27/2004 10:49 PM
|
Errors
I installed the pages you had done along with the DB's and set the DSN in the mx admin page but i am getting this:
The data source named "ClientVaribles" is not a valid client storage DSN. Please define client storage dsn via the admin pages. The error occurred in C:\CFusionMX\wwwroot\security\Application.cfm: line 3 1 : <cfsetting enablecfoutputonly="yes"> 2 : <!--- First declare the application and manage whitespace ---> 3 : <cfapplication name="securityf" clientmanagement="yes" sessionmanagement="yes" setclientcookies="yes" clientstorage="ClientVaribles">
Posted by: bill
Posted on: 07/21/2004 08:05 PM
|
Re: Errors
Bill, i had the same problem you did with the DSN. Notice the error message reads "Please define client storage dsn via the admin pagea." The key words are "client storage" DSN. After you set up the clientVariables DB as a DSN, go to your CF Administrator page. Under SERVER SETTINGS, click on Client Variables.
Select the clientVariables DB from the DSN list to add as a client store. That should get you past that problem.
Great tutorial btw.
Posted by: Xerf
Posted on: 07/25/2004 07:27 PM
|
not sure if it matters
it might also help if you spell Variables right in ClientVariables -- you don't have the "a" in the word.
Posted by: Rob
Posted on: 09/09/2004 01:57 PM
|
entering cfm pages
What causes the login page to pop back after a successful login? I have my application page in the root directory. The cflocation after login is another cfm page. Is that the reason? If it is what can I do?
Thanks John
Posted by: John
Posted on: 09/11/2004 02:20 PM
|
ColdFusionComnponents
All the .cfcs got to be registered?
Posted by: ed
Posted on: 09/13/2004 04:50 PM
|
Why two dbs /loosing it now
Can someone please explain to me where the two dbs come into this? I set up the clientVariables DB as a DSN, my hosts went to the CF Administrator page. Under SERVER SETTINGS, click on Client Variables.
I get an error as it doesn't have a table called state in it. The key words are "client storage" DSN. This is really tricky tutorial!
Posted by: ed
Posted on: 09/13/2004 04:59 PM
|
What we need in short...
Ok, I played with this for a little while trying to be a smart kid... managed to get a few things working, however... still fairly confused.
I think what we need clarification on is the following:
1. clientvariables.mdb - what is the datasource name? 2. security.mdb - what is the datasource name? 3. Setting clientVariables in the Server Settings (new to me) - but I did it. 4. Please explain how we need to set up the #Application.cfcRoot# deal. It seems this is a very pickey piece of the code. Does the site HAVE to be in a certain folder/area on my comp? How can we edit that to work? 5. I have no /castlefnord/securityBACK/ folder with the download and that is causeing problems too.
Sorry about this, I'm just trying to learn as much as I can from these tutorials (as Im sure many others are as well) and unfortunatly that means I need a touch more explination at times.
I appreciate any help you can give. Thanks.
Posted by: urban_fusion
Posted on: 10/06/2004 06:40 AM
|
A few things.
Sorry, I stopped writing ColdFusion altogether and haven't even looked at this article in a long time. Pretty interesting it is still as popular as it is.
Sounds like there is a bit of confusion centered around the clientVariables datasource. If you get something like this "The data source named "ClientVaribles" is not a valid client storage DSN" it is because you have not established the datasource as client variable storage in the coldfusion administrator. When you do that step correctly the cf administrator will create a couple of tables in the database.
The benefit of using a datasource instead of cookies is multi-fold. From a security perspective it is good because the end client will never see the data you are storing ... whereas if you were to use a cookie it would be easy to see what you are storing and easier to modify it.
Secondly, you will eventually want to store more complex objects as client variables. Say, for example, you create a structure that represents the user and has several keys, one of which is an array, one of which is a query, and one of which is another sturcture. You can serialize the structure using the wddx tags and store the resulting string in a database. The wddx string can get quite long depending on the complexity of the data. There is a definite limit as to how long of a string you can store in a cookie that you can circumvent with the clientVariables datasource. So, in a nutshell, you get additional security and a wicked cool storage mechanism for complex data types.
To the person asking the list of questions:
1. clientVariables (about the 9th paragraph in the article)
2. security (about the 10th paragraph in the Application.dsn variable)
3. It's a very good thing to get in the habit of.
4. You have the ability to place cfc's anywhere in the directory structure or even on the machine in non web accesible folders. The cold fusion documentation goes into great effort to explain the process in detail. I placed the cfcs in this example under a web accesible directory to avoid explaining how to customize the location since the cf documentation does that so well. The naming convention is roughly borrowed from java standards. Unfortunately it does seem extremely picky when you first start using that syntax, but your slowly walking into the java underbelly of cf. When I first started using cfcs I did not understand that particular syntax ... now it's very rare that I use /this/that syntax. Best bit of advice I can give you is to spend some time going through the cf docs ... that is an extremely important concept for you to understand.
5. doh ... not sure how the /castlefnord/securityBack directory got stuck in there, my apologies. Could you be more specific about the problem it is causing? If memory serves correctly that was literally just a backup directory for the article and shouldn't interfere with anything, but it has been a while.
Hope that helps!
Kevin Bridges cyberswat.AT.gmail.DOT.com
Posted by: Kevin Bridges
Posted on: 11/02/2004 04:42 AM
|
one sticky problem
great tutorial, Kevin, easy to read and understand.
i have one sticky problem regarding login methods and i was hoping you might be able to point me in the right direction:
i let users create their own accounts. but now, i would like to know when a user is creating multiple accounts.
i was thinking to:
1. when user tries to log in, set a temp cookie using JavaScript (to make sure user's browser allows both JavaScript and cookies)
2. if it works, delete temp cookie. if not, block login
3. if not exists, set a permanent cookie containing the user's id
4. when someone creating a new account, check for permanent cookie
but i sure there must be a better way to do this!
thanks
ion
Posted by: ion
Posted on: 01/12/2005 09:05 AM
|
Re: castlefnord and securityBACK
Presuming you have maintained the original structure of this application, and placed all of the files and folders into the root folder of your site. Just change each reference to these folders - on lines 7, 8 and 9 of 'Application.cfm', to the name of your root folder, e.g. My security test site root folder is called 'security', so I edited lines 7, 8 and 9 as follows:
<cfparam name="Application.webRoot" type="string" default="/security/"> <cfparam name="Application.machineRoot" type="string" default="/security/"> <cfparam name="Application.cfcRoot" type="string" default="security.com">
PS. Make sure you leave the reference to the 'com' folder after your root folder on line 9.
Hope this helps!
Posted by: Chris Bowyer
Posted on: 02/02/2005 08:13 PM
|
login
Hi All,
Hope yopu can help here... When user uses logout, he gets a confirmation "Thanks you..." If I copy the url and reenter in the browser, I realise that actually the logout is not working properly (showing previous page before logout option is hit...) Question 1: How can I make sure that when I user logs out indeed the page is not cached and user is send to login page Question 2: If user bookmarks a page, How can I make sure that the page is not shown and it redirects the user to the login page instead Answers are range og session /cookies not sure could be both...I am just stumped and need to find solutions....
Thanks in advance!
Max
Posted by: max sommer
Posted on: 02/27/2005 10:07 PM
|
CFLOGIN MADE EASY
Hey guys, After reading this tutorial and your comments I decided to write a cflogin tutorial that was bumped down a few notches so the level of understanding was much easier to identify. Here it is: http://tutorial355.easycfm.com Enjoy.
Posted by: Wesley Geddes
Posted on: 06/05/2005 02:17 PM
|
Populating the roles
I was looking in the cf documentation and the tutorials. Does everyone use one text field to hold all the roles. (comma delemited list). Or do they hold each role in a seperate record for that user in the roles table, using a cfloop to populate the roles variable?
Thanks,
Posted by: Scott Casteel
Posted on: 09/26/2005 04:13 PM
|
multiple usernames?
why / when would a member even need multiple usernames and passwords?
Posted by: kevin
Posted on: 10/20/2005 01:56 AM
|
remember me
I would sure like to see this same tutorial expanded to provided autiomatic login for those who had a previously stored cookie on their PC. Have you contemplated this?
Thanks!
Posted by: Tom McHugh
Posted on: 05/19/2006 09:21 AM
|
Awsome!
Everyone who loves MX7 please raise thier hand! *raises his hand* ... *and waves it around* ... *screams "Me, Me, ME!".
This is an excelent tutorial, thoroughly explaining a perviously poorly documented feature of ColdFusion.
I've just run through this and it is such as simple proceedure to implement, and i was even suprised to find that upon discussion with my ISP that they already have a MySQL database running that is used for ClientStorage so i didnt even have to create an additional DSN for that element.
Thanks again for this tutorial Kevin, when first reading i thought i might have a few issues with it, however i installed the app in around 5 minutes with not a single issue.
As one further note, i would have liked to seen a little documentation on the Javascript for the forms.
Thanks again,
Rob Rawlins
Posted by: Rob Rawlins
Posted on: 06/08/2006 03:06 AM
|
cached cflogin?
I'm having the same problem that 'John' had. After successful login the user get directed back to the login page after clicking a caouple of links. What's weird is another user with exactly the same roles has no trouble. I also find that after changing a password or user name the old user name still works - it's like the cflogin is cached in some way. Anyone else had this issue?
Posted by: mark
Posted on: 06/08/2006 08:31 AM
|
Nice Script 1 little problem
I have only 1 small problem when it comes to the join page. When I preview it in my browser I get an error about the Variable GETURL is undefined. Do you know what I should define it as? Kinda new at this so any help would be very much appreciated. TIA
Posted by: Rob P.
Posted on: 08/22/2006 04:15 PM
|
Creating An Account
While attempting to create an account with this tutorial, when it is attempting to add the user information into security, I get a syntax error on security.cfc line 15:
<cfqueryparam value="#arguments.memberID#" cfsqltype="CF_SQL_INTEGER"/>)
Did anyone else experience this/have a suggestion for what is going on? So far my debugging has shown nothing.
Posted by: Kari
Posted on: 08/25/2006 02:33 PM
|
creating an account
hey guyz i have downloaded the code and put it in my site....whats happenin is...when am tryin to create a member...am gettin the error message "error in INSERT into" statement...can some one tell me what is this....i tried but whats happenin is the all tables r gettin populated except for the security and security link table....can some tell me y this is happening and what hsould i do ......plz...thanx
Posted by: eli
Posted on: 02/12/2007 02:28 PM
|
creating hierarchy in logins
Hi I have created a login page but i want some restrictions on it. Set hierarchy so that when users loged in they can only view their order placed or data which they have entered.They should be restriced from other users's entry. Please asssit
Posted by: ashalatha
Posted on: 05/01/2008 12:25 AM
|