Index: main/waeup.sirp/trunk/src/waeup/sirp/jambtables/authentication.py
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/jambtables/authentication.py	(revision 5440)
+++ main/waeup.sirp/trunk/src/waeup/sirp/jambtables/authentication.py	(revision 5441)
@@ -47,4 +47,6 @@
 class ApplicantAccount(Account):
     """An account for applicants.
+
+    XXX: Very likely we do not need this at all.
     """
     def __init__(self, reg_no, ac):
@@ -75,17 +77,25 @@
 
 class ApplicantPrincipalInfo(object):
+    """Infos about an applicant principal.
+    """
     grok.implements(IApplicantPrincipalInfo)
 
     # def __init__(self, id, title, description):
-    def __init__(self, reg_no, access_code):
-        self.id = '%s-%s' % (reg_no, access_code)
+    # def __init__(self, reg_no, access_code):
+    def __init__(self, access_code, jamb_reg_no=None):
+        self.id = princial_id(access_code, jamb_reg_no)
         self.title = u'Applicant'
         self.description = u'An Applicant'
         self.credentialsPlugin = None
         self.authenticatorPlugin = None
-        self.reg_no = reg_no
+        self.reg_no = jamb_reg_no
         self.access_code = access_code
 
 class ApplicantPrincipal(Principal):
+    """An applicant principal.
+
+    Applicant principals provide an extra `access_code` and `reg_no`
+    attribute extending ordinary principals.
+    """
 
     grok.implements(IApplicantPrincipal)
@@ -104,4 +114,9 @@
 class AuthenticatedApplicantPrincipalFactory(grok.MultiAdapter):
     """Creates 'authenticated' applicant principals.
+
+    Adapts (principal info, request) to an ApplicantPrincipal instance.
+
+    This adapter is used by the standard PAU to transform
+    PrincipalInfos into Principal instances.
     """
     grok.adapts(IApplicantPrincipalInfo, IRequest)
@@ -173,5 +188,5 @@
         sessionData = session.get(
             'zope.pluggableauth.browserplugins')
-        access_code = request.get(self.acccesscode_field, None)
+        access_code = request.get(self.accesscode_field, None)
         jamb_reg_no = request.get(self.jamb_reg_no_field, None)
         credentials = None
@@ -211,10 +226,11 @@
         if not isinstance(credentials, dict):
             return None
-        if not 'login' in credentials.keys():
-            return None
-        if not 'password' in credentials.keys():
-            return None
+        if not 'accesscode' in credentials.keys():
+            return None
+        if not 'jambregno' in credentials.keys():
+            credentials['jambregno'] = None
         return ApplicantPrincipalInfo(
-            credentials['login'], credentials['password']
+            credentials['accesscode'], credentials['jambregno']
+            # credentials['login'], credentials['password']
             )
 
@@ -222,6 +238,10 @@
         """Returns an IPrincipalInfo object for the specified principal id.
 
-        Currently we always return ``None``, indicating, that the principal
-        could not be found.
+        This method is used by the stadard PAU to lookup for instance
+        groups. If a principal belongs to a group, the group is looked
+        up by the id.  Currently we always return ``None``,
+        indicating, that the principal could not be found. This also
+        means, that is has no effect if applicant users belong to a
+        certain group. They can not gain extra-permissions this way.
         """
         return None
