def interactively_acquire_token(self) -> str:
"""
Walks the user through executing a login into the Dualis-System to get the Token and saves it.
@return: The Token for Dualis.
"""
print('[The following Input is not saved, it is only used temporarily to generate a login token.]')
token = None
while token is None:
dualis_username = input('Username for Dualis: ')
dualis_password = getpass('Password for Dualis [no output]: ')
try:
token = login_helper.obtain_login_token(dualis_username, dualis_password)
except RequestRejectedError as error:
print('Login Failed! (%s) Please try again.' % (error))
except (ValueError, RuntimeError) as error:
print('Error while communicating with the Dualis System! (%s) Please try again.' % (error))
self.config_helper.set_property('token', token)
return token
评论列表
文章目录