<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def authenticate_keystone_admin(self, keystone_sentry, user, password, tenant=None, api_version=None, keystone_ip=None, user_domain_name=None, project_domain_name=None, project_name=None):
 """Authenticates admin user with the keystone admin endpoint."""

        self.log.debug('Authenticating keystone admin...')
        if not keystone_ip:
            keystone_ip = keystone_sentry.info['public-address']

        # To support backward compatibility usage of this function
        if not project_name:
            project_name = tenant
        if api_version == 3 and not user_domain_name:
            user_domain_name = 'admin_domain'
        if api_version == 3 and not project_domain_name:
            project_domain_name = 'admin_domain'
        if api_version == 3 and not project_name:
            project_name = 'admin'

        return self.authenticate_keystone(
            keystone_ip, user, password,
            api_version=api_version,
            user_domain_name=user_domain_name,
            project_domain_name=project_domain_name,
            project_name=project_name,
            admin_port=True)