'Return the authenticated userid or ``None``.
If no callback is registered, this will be the same as
``unauthenticated_userid``.
If a ``callback`` is registered, this will return the userid if
and only if the callback returns a value that is not ``None``.'

def authenticated_userid(self, request):

    debug = self.debug
    userid = self.unauthenticated_userid(request)
    if (userid is None):
        (debug and self._log('call    to    unauthenticated_userid    returned    None;    returning    None', 'authenticated_userid', request))
        return None
    if (self._clean_principal(userid) is None):
        (debug and self._log(('use    of    userid    %r    is    disallowed    by    any    built-in    Pyramid    security    policy,    returning    None' % userid), 'authenticated_userid', request))
        return None
    if (self.callback is None):
        (debug and self._log(('there    was    no    groupfinder    callback;    returning    %r' % (userid,)), 'authenticated_userid', request))
        return userid
    callback_ok = self.callback(userid, request)
    if (callback_ok is not None):
        (debug and self._log(('groupfinder    callback    returned    %r;    returning    %r' % (callback_ok, userid)), 'authenticated_userid', request))
        return userid
    (debug and self._log('groupfinder    callback    returned    None;    returning    None', 'authenticated_userid', request))
