def user_verify_password(user_id=None, name=None, password=None, profile=None, **connection_args):
 kstone = auth(profile, **connection_args)
 if ('connection_endpoint' in connection_args):
  auth_url = connection_args.get('connection_endpoint')
 elif (_OS_IDENTITY_API_VERSION > 2):
  auth_url = __salt__['config.option']('keystone.endpoint', 'http://127.0.0.1:35357/v3')
 else:
  auth_url = __salt__['config.option']('keystone.endpoint', 'http://127.0.0.1:35357/v2.0')
 if user_id:
  for user in kstone.users.list():
   if (user.id == user_id):
    name = user.name
    break
 if (not name):
  return {'Error': 'Unable to resolve user name'}
 kwargs = {'username': name, 'password': password, 'auth_url': auth_url}
 try:
  if (_OS_IDENTITY_API_VERSION > 2):
   client3.Client(**kwargs)
  else:
   client.Client(**kwargs)
 except (keystoneclient.exceptions.Unauthorized, keystoneclient.exceptions.AuthorizationFailure):
  return False
 return True

def user_verify_password ( user_id = None , name = None , password = None , profile = None , ** connection_args ) : kstone = auth ( profile , ** connection_args ) if ( 'connection_endpoint' in connection_args ) : auth_url = connection_args . get ( 'connection_endpoint' ) elif ( _OS_IDENTITY_API_VERSION > 2 ) : auth_url = __salt__ [ 'config.option' ] ( 'keystone.endpoint' , 'http://127.0.0.1:35357/v3' ) else : auth_url = __salt__ [ 'config.option' ] ( 'keystone.endpoint' , 'http://127.0.0.1:35357/v2.0' ) if user_id : for user in kstone . users . list ( ) : if ( user . id == user_id ) : name = user . name break if ( not name ) : return { 'Error' : 'Unable to resolve user name' } kwargs = { 'username' : name , 'password' : password , 'auth_url' : auth_url } try : if ( _OS_IDENTITY_API_VERSION > 2 ) : client3 . Client ( ** kwargs ) else : client . Client ( ** kwargs ) except ( keystoneclient . exceptions . Unauthorized , keystoneclient . exceptions . AuthorizationFailure ) : return False return True
verify a users password cli examples: .