MCPcopy Create free account
hub / github.com/Keeper-Security/Commander / _fail_headless_auth

Function _fail_headless_auth

keepercommander/auth/console_ui.py:31–43  ·  view source on GitHub ↗

In headless/service mode, persistent login often needs a follow-up prompt (password, SSO, 2FA, device approval) that cannot be answered. Log once and cancel so the caller exits cleanly instead of looping or spamming getpass.

(step)

Source from the content-addressed store, hash-verified

29
30
31def _fail_headless_auth(step):
32 """In headless/service mode, persistent login often needs a follow-up prompt
33 (password, SSO, 2FA, device approval) that cannot be answered. Log once and
34 cancel so the caller exits cleanly instead of looping or spamming getpass."""
35 global _HEADLESS_AUTH_MSG_SHOWN
36 if not _HEADLESS_AUTH_MSG_SHOWN:
37 _HEADLESS_AUTH_MSG_SHOWN = True
38 logging.error(
39 'Persistent login is not working in this non-interactive environment '
40 '(possibly due to an IP/location change). '
41 'Re-run Commander/Docker setup from this network, then restart the service.'
42 )
43 step.cancel()
44
45
46class ConsoleLoginUi(login_steps.LoginUi):

Callers 5

on_device_approvalMethod · 0.85
on_two_factorMethod · 0.85
on_passwordMethod · 0.85
on_sso_redirectMethod · 0.85
on_sso_data_keyMethod · 0.85

Calls 2

errorMethod · 0.45
cancelMethod · 0.45

Tested by

no test coverage detected