Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically wait for device login result #685

Closed
adombeck opened this issue Dec 9, 2024 · 4 comments
Closed

Automatically wait for device login result #685

adombeck opened this issue Dec 9, 2024 · 4 comments

Comments

@adombeck
Copy link
Contributor

adombeck commented Dec 9, 2024

It feels like an unnecessary step to let the user select 1. Wait for the QR code scan result on the command-line. Can't we do that automatically (and cancel/restart the waiting when the user selects 2. Request new login code)?

@adombeck adombeck added the jira label Dec 9, 2024
@3v1n0 3v1n0 added the pam label Dec 12, 2024
@3v1n0
Copy link
Collaborator

3v1n0 commented Dec 12, 2024

Not really... We can't stop PAM conversations once started, not we can do those in multiple threads.

So it implies that if we start the "waiting", then there's no way to stop it from the client side, thus we only could change the keybindings (like Enter to wait and r to go back to select things), but not the fact that user has to initiate it.

@3v1n0 3v1n0 closed this as not planned Won't fix, can't repro, duplicate, stale Dec 12, 2024
@adombeck
Copy link
Contributor Author

How does it work in the GDM, where we do wait automatically? Could we run a loop to check in intervals if there is an authentication result (and waits for keyboard input for the rest of the time)?

@3v1n0
Copy link
Collaborator

3v1n0 commented Dec 13, 2024

In GDM we use a PAM extension, so we can manage the conversations going back and forth without user interaction (by polling).

We could have used even normal conversations, but that's possible because in GDM there's an UI with a main loop that manages the events and so we can just receive a conversation and reply automatically.

For PAM native apps, such as SSH is, that's not possible because it's SSH (or sudo, or any other PAM app) that controls the UI, so as module level we can only act to such requests.

If we'd started the waiting phase automatically without user being able to explicitly start it, then once a waiting authentication mode is selected, then there's no way to go back to select another and there's no way to request another code.

Maybe we could start the waiting phase immediately with:

== Qr Code authentication ==
Enter the code in the login page
https://ubuntu.com
       1337

  1. Check for the QR code scan result
  2. Regenerate code
Or enter 'r' to go back to select the authentication method
Choose action:
> 1

But then... If there are issues during such phase we can't notify until the user has manually requested for 1, since we couldn't just wait without user interaction or they won't be able to stop, cancel or restart it (for a new code).

@adombeck
Copy link
Contributor Author

For PAM native apps, such as SSH is, that's not possible because it's SSH (or sudo, or any other PAM app) that controls the UI, so as module level we can only act to such requests.

Ah, so if I understand correctly, the problem is that we need to give control back to the app in order for it to print the message, and then it only calls the PAM module again once the user responded. Is that correct?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants