def authenticate(request):
    """Identify a principal for a request.

        If a principal can be identified, then return the
        principal. Otherwise, return None.

        The request object is fairly opaque. We may decide
        that it implements some generic request interface.

        .. note::

           Implementation note: It is likely that the component will dispatch
           to another component based on the actual
           request interface. This will allow different
           kinds of requests to be handled correctly.

           For example, a component that authenticates
           based on user names and passwords might request
           an adapter for the request as in::

              getpw = getAdapter(request, context=self)

           The ``context`` keyword argument is used to control
           where the :class:`ILoginPassword` component is searched for.
           This is necessary because requests are placeless.
        """
