CAS + ColdFusion

Posted by Quinn Madson | Posted in | Posted on 9:24 AM


The example available from JA-SIG is some of the ugliest code I've seen lately. This is what I came up with (based on their example code):

<cfapplication name="my_awesome_app_name_here"
clientmanagement="yes" sessionmanagement="yes"
setclientcookies="yes" setdomaincookies="no"
<!--- globals --->
<cfparam name="url.ticket" default="">
<cfparam name="username" default="">
<cfparam name="url.action" default="">
cas_path = "";
app_path = "";
cas_url = cas_path & "login?" & "service=" & app_path;

<!--- session init --->
<cflock timeout="10" scope="session" type="readonly">
<cfparam name="session.username" default="">
<cfparam name="session.authorized" default="0">

<!--- logout action --->
<cfif url.action eq "logout">
<!--- session reset --->
<cflock scope="session" timeout="30" type="exclusive">
<cfset session.username = "">
<cfset session.authorized = "0">

<cfset cas_url = cas_path & "logout">
<cflocation url="#cas_url#" addtoken="false">

<!--- auth check --->
<cfif not len(trim(session.username))>
<cfif not len(trim(ticket))>
<cflocation url="#cas_url#" addtoken="no">
<cfset cas_url = #cas_path# & "serviceValidate?ticket=" & url.ticket & "&" & "service=" & app_path & "/">
<cfhttp url="#cas_url#" method="get"/>
<cfset objXML = xmlParse(cfhttp.filecontent)>
<cfset SearchResults = XmlSearch(objXML,"cas:serviceResponse/cas:authenticationSuccess/cas:user")>

<cfif arraylen(SearchResults)>
Raw XML:<cfdump var="#cfhttp.filecontent#">
<cfdump var="#objXML#" label="CAS Results">
<cfdump var="#SearchResults#" label="Parsed CAS Results">
<cfset username = SearchResults[1].XmlText>
<cflock scope="session" timeout="30" type="exclusive">
<cfset session.username = username>
<cfset session.authorized = "1">
<cflocation url="#cas_url#" addtoken="no">

<cfif structKeyExists(url, "accessdenied")>
Access Error
<cfdump var="#session#" label="ColdFusion Session Object">
<a href="?action=logout">Logout</a><br/>
Honestly, it's a pretty simple process:
  • Check for a ColdFusion session
  • If one doesn't exist, redirect to CAS and provide a call back URL
  • When CAS redirects back to your application you grab the ticket and verify it server to server via cfhttp.
  • If the ticket checks out, you create a ColdFusion session and use it within your application.
The point of this example is to keep it simple. The code is commented to clue you into where the different components would plug into the framework of your choice.

Zimbra URLs

Posted by Quinn Madson | Posted in | Posted on 7:08 AM


Zimbra has a bunch of built in functionality for rendering HTML versions of calendars as well as feeds such as RSS. This keeps coming up with Zimbra users inside and outside of our organization. I'm posting it here for future reference.

For an HTML representation of a public calendar we use a URL like this:

The view=week is optional; I just wanted to show an example. The view defaults to a month view and can be changed by the user. If the calendar is not set to public, you'll get a permission error. If you want to show a private calendar, you can use something like:

This will show the free and busy information but, no meeting details. For your purposes, you will need to change "" to your Zimbra server and change "qkmadson" or "bmaas" to one of your usernames. You may want to take a look at this blog entry:

The show examples of how to use various feed options in Zimbra. For example, if you wanted to use RSS:

RapidSVN currently broken in Ubuntu Repository

Posted by Quinn Madson | Posted in | Posted on 9:01 AM


The current package for RapidSVN segfaults constantly with the current version (as of today's date) in the Hardy Heron repos. To fix this:

  • Grab the Intrepid Ibex package by editing: /etc/apt/sources.list
  • Do a search and replace: "hardy" for "intrepid".
  • Update your packages and reinstall RapidSVN.
You can do this from the GUI side with gedit and synaptic. From the command line:
sudo -s
vim /etc/apt/sources.list

in vi:

command line:
apt-get update
apt-get install rapidsvn
At this point, you should switch back to the hardy repos by editing sources.list and re-replacing intrepid for hardy.

Network Debugging w/ MVPMC

Posted by Quinn Madson | Posted in | Posted on 6:12 PM


While running the MVPMC software on MVC devices, sometimes I will receive an error that the streaming server cannot be found.

Check /var/log/messages for:

 dhcpd: DHCPACK on to 00:0d:fe:39:21:06 via eth0

if that's the last message, make sure you run:
/usr/sbin/in.tftpd -l -a :16869 -s /tftpboot -v
/usr/bin/mvprelay 16881 5906 6337 &