Index: /main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_webservices.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_webservices.py	(revision 10476)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_webservices.py	(revision 10477)
@@ -318,2 +318,17 @@
         self.assertEqual(xmlout, RESPONSE_XML)
         return
+
+    def test_check_credentials(self):
+        # make sure we can get student infos providing valid creds
+        server = ServerProxy('http://mgr:mgrpw@localhost/app')
+        self.setup_student(self.student)
+        stud_id = self.student.student_id
+        result = server.check_credentials('mykey', stud_id, 'spwd')
+        self.assertEqual(
+            result, {
+                'description': 'Anna Tester',
+                'email': 'aa@aa.ng',
+                'id': 'K1000000',
+                'type': 'student'}
+            )
+        return
Index: /main/waeup.kofa/trunk/src/waeup/kofa/students/webservices.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/students/webservices.py	(revision 10476)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/students/webservices.py	(revision 10477)
@@ -188,2 +188,27 @@
             return None
         return payments_dict
+
+    @grok.require('waeup.xmlrpc')
+    def check_credentials(self, key, username, password):
+        """Returns student data if username and password are valid,
+        None else.
+
+        We only query the students authenticator plugin in order not
+        to mix up with other credentials (admins, staff, etc.).
+
+        All additional checks performed by usual student
+        authentication apply. For instance for suspended students we
+        won't get a successful response but `None`.
+
+        This method can be used by CAS to authentify students for
+        external systems like moodle.
+        """
+        from zope.pluggableauth.interfaces import IAuthenticatorPlugin
+        auth = getUtility(IAuthenticatorPlugin, name='students')
+        creds = dict(login=username, password=password)
+        principal = auth.authenticateCredentials(creds)
+        if principal is None:
+            return None
+        return dict(email=principal.email, id=principal.id,
+                    type=principal.user_type,
+                    description=principal.description)
Index: /main/waeup.kofa/trunk/src/waeup/kofa/webservices.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/webservices.py	(revision 10476)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/webservices.py	(revision 10477)
@@ -34,5 +34,5 @@
     #ACCEPTED_IP = ('174.36.230.28', )
     ACCEPTED_IP = ('127.0.0.1', )
-    
+
     def update(self, P_ID=None):
         if P_ID == None:
