Re: RubyCAS Server and CouchDB

0 views
Skip to first unread message

Matt Zukowski

unread,
Dec 2, 2009, 2:54:27 PM12/2/09
to Nuo Yan, RubyCAS
RubyCAS uses databases for two different purposes: 1) for it's
internal workings (keeping track of sessions, tickets, etc.) and 2)
for verifying that the credentials entered by the user on the login
page are right/valid.

The two purposes are quite seperate. For purpose (1), I don't think
there's much point putting things on CouchDB. In fact a tiny SQLite
database is probably more than enough. This is just something that
sits there and you never have to think about. The data in this
internal database is temporary and of no real value.

(2) is where you might want to RubyCAS talking to CouchDB -- that is,
you may want to get RubyCAS to access an existing CouchDB database for
credential validation if this is where you're storing your list of
users and their passwords. RubyCAS allows for validating credentials
against a variety of back ends through "Authenticator" modules.
Currently modules are provided for authetication against various SQL
servers, against LDAP, ActiveDirectory, Google acounts, etc., but
there is no module for accessing CouchDB. This however would probably
be fairly easy to write.

Here's a snippet from the example config file that talks about writing
a custom authenticator:

# It should be relatively easy to write your own Authenticator class.
Have a look
# at the built-in authenticators in the casserver/authenticators directory. Your
# authenticator should extend the CASServer::Authenticators::Base class and must
# implement a validate() method that takes a single hash argument.
When the user
# submits the login form, the username and password they entered is passed to
# validate() as a hash under :username and :password keys. In the future, this
# hash might also contain other data such as the domain that the user
is logging
# in to.
#
# To use your custom authenticator, specify it's class name and path to the
# source file in the authenticator section of the config. Any other parameters
# you specify in the authenticator configuration will be passed on to the
# authenticator and made availabe in the validate() method as an @options hash.
#
# Example:
#
#authenticator:
# class: FooModule::MyCustomAuthenticator
# source: /path/to/source.rb
# option_a: foo
# another_option: yeeha

Also, have a look at this wiki page for some more tips:
http://code.google.com/p/rubycas-server/wiki/CustomLoginFormAndAuthenticator



On Mon, Nov 30, 2009 at 7:51 PM, Nuo Yan <yan...@gmail.com> wrote:
>
> Hi Matt,
> Sorry for the randomness of this email. But I've been trying to find answers online but failed. Does RubyCAS Server support non-relational databases like the CouchDB? If so, please let me know some related information.
> Thanks!
> Nuo
Reply all
Reply to author
Forward
0 new messages