def extensible_login(self, system, credentials):
        """ The extensible login system receives a system (e.g. FACEBOOK, or OPENID), and checks
        that with that system and certain credentials (in a particular format) identifies the user.
        For example, for Facebook, the system will be FACEBOOK and the credentials will be a base64
        string containing the oauth token which WebLab-Deusto will use to contact Facebook and 
        retrieve the user information. In other systems (such as OpenID), it will be used to 
        check in there is an existing session in the session database.

        The important point of this method is that we do not know the login when calling it. In the 
        method "login", the username is provided, the database is accessed to check what authentication
        mechanisms are used. With these mechanisms, the credentials are validated. Here, it is the 
        opposite way: the system provides a set of credentials and some external mechanism will check 
        who is the user, and once validated, it will check in the database who in WebLab-Deusto is that 
        user.
        """
        external_user_id, _ = self._validate_web_protocol_authn(system, credentials)
        # It's a valid external user, book it if there is a user linked
        try:
            db_session_id = self._db.check_external_credentials(external_user_id, system)
        except DbUserNotFoundError:
            raise LoginErrors.InvalidCredentialsError((system, external_user_id) % "%s User ID not found: %s")

        return self._reserve_session(db_session_id)
dataset/ETHPy150Open weblabdeusto/weblabdeusto/server/src/weblab/core/login/manager.py/LoginManager.extensible_login/swapped operands of `%`