Index: /main/waeup.cas/trunk/waeup/cas/authenticators.py
===================================================================
--- /main/waeup.cas/trunk/waeup/cas/authenticators.py	(revision 10474)
+++ /main/waeup.cas/trunk/waeup/cas/authenticators.py	(revision 10475)
@@ -1,4 +1,5 @@
 """Components that do the real authentication stuff.
 """
+import re
 from pkg_resources import iter_entry_points
 
@@ -117,6 +118,30 @@
     name = 'kofa1'
 
-    def __init__(self, auth_backends=None):
-        self.backends = auth_backends
+    def __init__(self, auth_backends="{}"):
+        try:
+            self.backends = eval(auth_backends)
+        except:
+            raise ValueError('auth_backends must be a '
+                             'valid Python expression.')
+        self._check_options()
+
+    def _check_options(self):
+        if not isinstance(self.backends, dict):
+            raise ValueError('Backends must be configured as dicts.')
+        for key, val in self.backends.items():
+            if not isinstance(val, dict):
+                raise ValueError(
+                    'Backend %s: config must be a dict' % key)
+            if not 'url' in val:
+                raise ValueError(
+                    'Backend %s: config must contain an `url` key.' % key)
+            if not 'marker' in val:
+                self.backends[key]['marker'] = '.+'
+            try:
+                re.compile(self.backends[key]['marker'])
+            except:
+                raise ValueError(
+                    'Backend %s: marker must be a valid regular expr.:' % (
+                        key,))
 
     def check_credentials(self, username='', password=''):
Index: /main/waeup.cas/trunk/waeup/cas/tests/test_authenticators.py
===================================================================
--- /main/waeup.cas/trunk/waeup/cas/tests/test_authenticators.py	(revision 10474)
+++ /main/waeup.cas/trunk/waeup/cas/tests/test_authenticators.py	(revision 10475)
@@ -62,5 +62,5 @@
     inst1 = dict(
         url = 'http://localhost:6666/app',
-        marker = '^M[0-9]+',
+        marker = '^M[0-9]+$',
         )
     )
@@ -76,10 +76,25 @@
         # all options have sensible defaults
         auth = KofaAuthenticator()
-        assert auth.backends is None
+        assert auth.backends == {}
 
     def test_options(self):
         # we can pass options
-        auth = KofaAuthenticator(auth_backends=BACKENDS)
+        auth = KofaAuthenticator(auth_backends=str(BACKENDS))
         assert auth.backends == BACKENDS
+        auth = KofaAuthenticator(auth_backends='{"foo": {"url": "bar"}}')
+        assert auth.backends['foo']['marker'] == '.+'
+        self.assertRaises(
+            ValueError, KofaAuthenticator, auth_backends='not-a-py-expr')
+        self.assertRaises(
+            ValueError, KofaAuthenticator, auth_backends='"Not a dict"')
+        self.assertRaises(
+            ValueError, KofaAuthenticator,
+            auth_backends='{"foo": "not-a-dict"}')
+        self.assertRaises(
+            ValueError, KofaAuthenticator,
+            auth_backends='{"foo": {"no-url-key": "bar"}}')
+        self.assertRaises(
+            ValueError, KofaAuthenticator,
+            auth_backends='{"foo": {"url": "bar", "marker": "inv_re)"}}')
 
     def test_paste_deploy_options(self):
