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

email and password autocomplete in Browser mode #1309

Closed
lolgab opened this issue Jul 5, 2024 · 6 comments
Closed

email and password autocomplete in Browser mode #1309

lolgab opened this issue Jul 5, 2024 · 6 comments

Comments

@lolgab
Copy link

lolgab commented Jul 5, 2024

It would be nice if the browser mode could autocomplete the email and password when logging in in Google. It's annoying having to type the password especially for people who use their browser's password manager, since the browser runs in a clean session (as it should).

@cjerdonek
Copy link

If you run saml2aws --help, you can see there is a --browser-autofill option:

--browser-autofill

  Configures browser to autofill the username and password. (env: SAML2AWS_BROWSER_AUTOFILL)

@lolgab
Copy link
Author

lolgab commented Jul 6, 2024

Oh wow, had no idea, that's wonderful, thank you

@lolgab
Copy link
Author

lolgab commented Jul 6, 2024

It doesn't seem to work though. Maybe Google changed their login page.

@cjerdonek
Copy link

cjerdonek commented Jul 6, 2024

It doesn't seem to work though. Maybe Google changed their login page.

Yeah, I'm not surprised. When I looked at the code implementing their auto-fill feature, it seemed to make some pretty strong assumptions about how the login page needs to be structured. The code can be find here (autoFill() function of pkg/provider/browser/browser.go):

var autoFill = func(page playwright.Page, loginDetails *creds.LoginDetails) error {
passwordField := page.Locator("input[type='password']")
err := passwordField.WaitFor(playwright.LocatorWaitForOptions{
State: playwright.WaitForSelectorStateVisible,
})
if err != nil {
return err
}
err = passwordField.Fill(loginDetails.Password)
if err != nil {
return err
}
keyboard := page.Keyboard()
// move to username field which is above password field
err = keyboard.Press("Shift+Tab")

Thus, I would keep this issue but retitle it to something like, "Make --browser-autofill feature work with Google's login page."

@cjerdonek
Copy link

cjerdonek commented Jul 6, 2024

Btw, the following issue is related to making --auto-fill work with Google's login page: #1295

@lolgab lolgab closed this as not planned Won't fix, can't repro, duplicate, stale Jul 7, 2024
@lolgab
Copy link
Author

lolgab commented Jul 7, 2024

Thank you, I will follow that issue then 👍

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

No branches or pull requests

2 participants