About DRAM New World Radio Mission and History Collection Development Becoming a DRAM ParticipantTrial Signup FormSteps to Membership Carnegie Classifications & Fees Public Library Classifications and Fees DRAM for UsersFrequently Asked Questions (FAQ)Troubleshooting Report an Error in DRAM Technical Requirements Proxy Configuration Promotional Materials Advanced Search Techniques Where Is My Institution? What's My IP Address? DRAM ParticipantsRecord LabelsComposers Institutions DRAM Staff and ContactsStaff MembersBoard of Directors Contact Us For DevelopersCustomizing Access Control with Darwin Streaming ServerLegalDRAM Privacy PolicyTerms and Conditions |
Customizing Access Control with Darwin Streaming Server[The DRAM project relies on a customized version of the Darwin Streaming Server to stream the audio available on our system. This document is aimed towards developers who would like to use the same or similar customizations for their own projects. The current DRAM-DSS distribution can be downloaded here.] Darwin Streaming Server (DSS) is a common choice for organizations wishing to provide streaming services to their userbase. However, limited support is available for authentication methods other than HTTP Basic, and there is no plugin API to speak of. This document will provide an overview of the modifications necessary to implement new authentication methods, specifically using MySQL to authenticate users against an existing web session database. Shibboleth AuthenticationThe original impetus for the DRAM project to modify the DSS source was to provide support for Shibboleth authentication services. The initial design prototype had a significant dependency on Shibboleth, which is why many online references about Shibboleth-DSS integration refer to the DRAM project. However, additional authentication requirements led to development of a more method-neutral login layer, which is the approach we will take here. Working With the DSS SourceIt's important to be prepared for some of the idiosyncrasies of the source DSS distribution. Our modifications are based on version 5.5.5 of the DSS source, and at the time of that release, we found that the Install script was hugely broken. A number of the installation steps were broken, and all of the paths were hardcoded. Also, the Build script isn't particularly diligent about informing the builder of compilation errors. A quick and dirty solution to double-check your compile is to run Buildit a second time, which will only compile items that have failed previously. The DRAM-DSS distribution has been repaired for the most part, but has only been installed on a limited number of Linux distros, namely Ubuntu (Dapper, Feisty, and Gutsy), Debian, and Red Hat Enterprise Linux 5. It's likely that it will work on most other linux distros, but there may be some changes necessary. Custom DRAM Access ModulesBasically, there's two different access modules: APIModules/QTSSAccessModule/ShibMysql.cpp
APIModules/QTSSAccessModule/ModuSessionMysql.cpp
Working With SessionsThe latest DRAM-DSS access module (ModuSessionMysql.cpp) is built to be auth-method agnostic. It simply validates against a session database populated by your web application. They key to getting this to work properly is the proper abstraction of your web application's authentication code. Currently DRAM uses a custom Python application layer based on the Twisted framework, but your app can be written in any language, of course. For example, to do this in PHP should be straightforward. You'll need to have your sessions saved in the database (PHP saves them in a serialized file by default), so you'll have to look into using session_set_save_handler() to specify custom callbacks that will write the session info to MySQL. If you're using some kind of framework, like Drupal or Joomla, that should be taken care of already. If you do want to use the Apache module to provide Shibboleth authentication, you're kind of on your own. I believe that the Shibboleth module adds some stuff to the web server environment (in PHP this is added to the $_SERVER array) that you can use to see if the login was successful, and authenticate your sessions that way. This type of approach will allow you to provide alternate authentication mechanisms, which at the very least is useful for local development and testing, or when a Shibboleth IdP server is unavailable. You should probably modify/emulate the ModuSessionMysql access module, as it will do everything you want, and is written more securely. You'll just need to make sure the queries are using the right field names, etc. Also, the name of the parameter I appended to the DSS URL was 'sess', if you want to use something else you'll just need to modify that (in QTSSAccessModule.cpp, Line ~ 673). Here's the schema for the session table that the ModuSessionMysql access module reads from:
The key fields used by the authentication code are: id
user_id
client_ip
There's also a table of current DSS sessions. I'm not really sure what this is for, but I think DSS uses it as an authentication cache.
File Modification OverviewThis is a list of the files normally in the stock DSS distribution that have been modified in the DRAM-DSS distribution. streamingserver.xml
WebAdmin/src/streamingadminserver.pl
Install
Makefile.POSIX
APIStubLib/QTSS.h
APICommonCode/QTAccessFile.cpp
APIModules/QTSSAccessModule/QTSSAccessModule.cpp
Server.tproj/QTSServerPrefs.cpp
Server.tproj/RTSPSession.cpp
|
