Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Security Contexts

Status
Not open for further replies.

jmp99

MIS
Jun 10, 2001
1
US
Greetings,
I'm using CF Server 4.51 (Enterprise) w/ IIS4 on an NT4 Server.
I'm using NT user authentication in my Application.cfm file for a page I want to secure.
I've created local users and divided them into 2 local groups on my NT server.
What I'm trying to do is to properly setup Security Contexts in CF Administrator so that a designated resource in my page is available to only 1 of the 2 groups I created.

This is what I've done so far:
1. Assigned User Directories for my Security Context.
2. Created a Security Context:
3. Linked to User Directory I created and NT_Directory.
4. Created a Rule.
5. Created a Policy.
6. Assigned Rule and user group to Policy.


The problem is that any user in either group has access to the resources I'm protecting. I've also noticed that unless I assign NT_Directory, I cannot view any users or groups when attempting to assign them to my Policy.

Is there a step I'm missing in setting up the Security Contexts?
Any help is greatly appreciated. I've included a copy of my Application.cfm file below.

Thanks,
JMP


<!--- Check for a username --->
<CFPARAM name=&quot;HaveUsername&quot; default=&quot;Yes&quot;>

<CFIF IsDefined(&quot;Cookie.Username&quot;)>
<CFSET USERNAME=Cookie.Username>
<CFELSE>
<CFSET USERNAME=&quot;&quot;>
<CFIF IsDefined (&quot;Form.Username&quot;)>
<CFSET USERNAME=Form.Username>
<CFCOOKIE name=&quot;username&quot; value=&quot;#Form.Username#&quot;>
<CFELSE>
<CFSET HaveUsername = &quot;No&quot;>
</CFIF>
</CFIF>

<!--- Check for a password --->
<CFPARAM name=&quot;HavePassword&quot; default=&quot;yes&quot;>

<CFIF IsDefined(&quot;Cookie.Password&quot;)>
<CFSET password=Cookie.Password>
<CFELSE>
<CFSET password=&quot;&quot;>
<CFIF IsDefined(&quot;Form.Password&quot;)>
<CFSET password=Form.password>
<CFCOOKIE name=&quot;password&quot; value=&quot;#Form.Password#&quot;>
<CFELSE>
<CFSET HavePassword = &quot;No&quot;>
</CFIF>
</CFIF>

<!--- Check authentication status and if not authenticated handle it --->

<CFIF HaveUsername and HavePassword>
<CFTRY>
<CFAUTHENTICATE
SecurityContext=&quot;Test&quot;
Username=&quot;#username#&quot;
Password=&quot;#password#&quot;
setcookie=&quot;Yes&quot;>

<!-- If an exception is thrown, handle it -->
<CFCATCH type=&quot;Security&quot;>
<CFCOOKIE name=&quot;username&quot; value=&quot;&quot; expires=&quot;now&quot;>
<CFCOOKIE name=&quot;password&quot; value=&quot;&quot; expires=&quot;now&quot;>
<CFLOCATION url=&quot;denied.html&quot;>
</CFCATCH>
</CFTRY>
<CFELSE>
<!--- Output a Login Form --->
Enter Username and Password to Access this Web Page.<P>
<FORM action=&quot;Test.cfm&quot; method=&quot;post&quot;>
Username: <INPUT type=&quot;text&quot; name=&quot;username&quot;><br>
Password: <INPUT type=&quot;password&quot; name=&quot;password&quot;><br>
<INPUT type=submit value=&quot;Login&quot;>
</FORM>

<CFABORT>
</CFIF>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top