'Verifies and returns the user ID corresponding to the given
``login`` and ``password`` combination, or False if there was
no matching user.
:param str db: the database on which user is trying to authenticate
:param str login: username
:param str password: user password
:param dict user_agent_env: environment dictionary describing any
relevant environment attributes'

@classmethod
def authenticate(cls, db, login, password, user_agent_env):

    uid = cls._login(db, login, password)
    if (uid == SUPERUSER_ID):
        if (user_agent_env and user_agent_env.get('base_location')):
            try:
                with cls.pool.cursor() as cr:
                    base = user_agent_env['base_location']
                    ICP = api.Environment(cr, uid, {})['ir.config_parameter']
                    if (not ICP.get_param('web.base.url.freeze')):
                        ICP.set_param('web.base.url', base)
            except Exception:
                _logger.exception('Failed    to    update    web.base.url    configuration    parameter')
    return uid
