Open cjerdonek opened 2 weeks ago
I see that Playwright / playwright-go
has a Locator.focus()
API. It could be used in the following part of saml2aws
's code e.g. if the --browser-autofill
option isn't provided and/or if a username isn't given:
https://github.com/Versent/saml2aws/blob/e65a82694db8e5f4871974907adf86fe462be9c3/pkg/provider/browser/browser.go#L158-L183
saml2aws
's browser
package's autoFill()
function already has code to look for a password
element (but not for a username
field specifically), so the package could do something similar to look for a username
field prior to focusing:
https://github.com/Versent/saml2aws/blob/e65a82694db8e5f4871974907adf86fe462be9c3/pkg/provider/browser/browser.go#L205-L206
Hello @cjerdonek thank you for raising this issue. Could you please submit a PR?
@mapkon Sure, I can probably put something together within the next few weeks, given that you're interested. Thanks!
Hi, when using the "Google Apps" provider on a Mac as described here with
SAML2AWS_IDP_PROVIDER=Browser
, when the browser opens and one starts typing, the text goes into the URL bar rather than the "Email or phone" field. As this is an auth flow, it would be more convenient if the "Email or phone" field started out with the focus.One thing that seems odd to me is that the cursor starts out blinking in the "Email or phone" field, making it look like that field already has focus. (When tabbing through, that cursor is blinking only when that field has focus.) However, the URL bar is also highlighted when starting out, making it look like the URL bar also has focus.
See below for a screenshot (note the highlighted URL bar and cursor in the "blinking" stage):