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

[Feature] Ability to control SSO browser opening separately from --stdout option #1102

Closed
moltar opened this issue Dec 29, 2022 · 5 comments
Closed
Labels

Comments

@moltar
Copy link

moltar commented Dec 29, 2022

Use case: I have a helper script that opens a new Firefox container for each profile, thereby allowing multiple sessions at the same time.

This script uses the -s option to get the session URL and then pipes the output into the firefox-container script.

However, I am not running the script from the terminal. It runs inside an Alfred Workflow, which does not print the output anywhere, so I cannot see the SSO login link.

This used to work fine in <@6.6.1, and it broke when #892 was introduced.

In my use case opening the browser for SSO was necessary, and then all of the session URLs I wanted to go into STDOUT to be captured into a variable.

Here's my script:

AWS_PROFILE=$1
AWS_LOGIN_URL=$(/usr/local/bin/aws-vault login -s "$AWS_PROFILE")

"$HOME/bin/firefox-container" --name "aws-$AWS_PROFILE" --orange --fingerprint "$AWS_LOGIN_URL"

It now breaks, because SSO login URL is piped into STDERR and is no longer opening the browser.

❯ ./launch.sh profile-name
+ AWS_PROFILE=profile-name
++ /usr/local/bin/aws-vault login -s profile-name
Open the SSO authorization page in a browser (use Ctrl-C to abort)
https://device.sso.region.amazonaws.com/?user_code=XYZ-XYZ

Relevant issues:

@farhansaed
Copy link

farhansaed commented Jan 11, 2023

I having the same problem I was capturing the SSO login URL with av login -s command and using it to open multiple brave browser windows for different aws accounts. It stopped working after 6.6.1 upgrade.
I think PR #892 broke more things than it resolved.
If instead of opening default browser just login-url is required introduce a new option -a (get sso authorization URL) and keep -s functionality same as before in previous version.

So effectively PR #892 broke the logic since running aws-vault login -s with SSO profiles first gives you an authorization link for the device which opens default browser (usually default browser is one where you are most likely to be signed in with your SSO identity provider.) so you sign in and it gives you console URL and doesn't open up another tab in the default browser. You can capture the URL (due to -s flag) and use it in another browser like brave or vivaldi etc.

@moltar @mtibben

@mtibben
Copy link
Member

mtibben commented Jan 17, 2023

Reverted in v6.6.2

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@github-actions github-actions bot added the stale label Jul 16, 2023
@moltar
Copy link
Author

moltar commented Jul 16, 2023

Stale not

@github-actions github-actions bot removed the stale label Jul 17, 2023
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@github-actions github-actions bot added the stale label Jan 14, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants