Skip to content

feat!: add GRANTED_BROWSER_PROFILE env var support for browser profile override#914

Open
billyjbryant wants to merge 3 commits intofwdcloudsec:mainfrom
billyjbryant:feat/browser-profile-env-var
Open

feat!: add GRANTED_BROWSER_PROFILE env var support for browser profile override#914
billyjbryant wants to merge 3 commits intofwdcloudsec:mainfrom
billyjbryant:feat/browser-profile-env-var

Conversation

@billyjbryant
Copy link

@billyjbryant billyjbryant commented Jan 15, 2026

Details

Add support for GRANTED_BROWSER_PROFILE and GRANTED_SSO_BROWSER_PROFILE environment variables to override the browser profile used when opening AWS console and during SSO login flows.

Fixes #886

Changes

Browser Profile for Console Access (GRANTED_BROWSER_PROFILE)

  • Add EnvVars to --browser-profile flag to automatically read from GRANTED_BROWSER_PROFILE environment variable
  • Remove browser-profile from getConsoleURL condition to prevent env var from inadvertently triggering console URL generation
  • Browser profile from env var is only used when actually launching browser (after all safety checks)

SSO Browser Profile (GRANTED_SSO_BROWSER_PROFILE)

  • Add --sso-browser-profile flag to assume, granted sso login, granted sso generate, and granted sso populate commands
  • Add SSOBrowserProfile field to ConfigOpts to pass browser profile through SSO login flow
  • Support GRANTED_SSO_BROWSER_PROFILE environment variable via flag EnvVars
  • Add test case for empty browser profile in launcher tests

Breaking Changes

The --browser-profile flag no longer triggers browser opening by itself.

Users must now explicitly use -c or -s flags along with --browser-profile to open a browser with the desired profile.

Previously, passing --browser-profile alone would open a browser window, but now it only sets which browser profile to use when a browser is opened via other flags. This prevents the GRANTED_BROWSER_PROFILE environment variable from inadvertently opening browsers.

Usage

Console Browser Profile

Users can now set a default browser profile via environment variable for console access:

export GRANTED_BROWSER_PROFILE="MyBrowserProfile"
assume -c my-aws-profile  # Will use "MyBrowserProfile" as the browser profile

The --browser-profile flag still takes precedence over the environment variable.

SSO Browser Profile

Users can set a default browser profile for SSO login flows:

export GRANTED_SSO_BROWSER_PROFILE="MySSOProfile"
granted sso login  # Will use "MySSOProfile" for SSO authentication
assume --sso --sso-start-url https://example.awsapps.com/start  # Will use "MySSOProfile"

Or use the flag directly:

granted sso login --sso-browser-profile MySSOProfile
assume --sso --sso-browser-profile MySSOProfile --sso-start-url https://example.awsapps.com/start

The --sso-browser-profile flag takes precedence over the GRANTED_SSO_BROWSER_PROFILE environment variable.

Testing

  • Added test case for empty browser profile in launcher tests
  • All existing tests continue to pass

BREAKING CHANGE: The --browser-profile flag no longer triggers browser opening by itself. Users must now explicitly use -c or -s flags along with --browser-profile to open a browser with the desired profile.

…e override

Add support for GRANTED_BROWSER_PROFILE environment variable to override
the browser profile used when opening AWS console with -c/-s flags.

Changes:
- Add EnvVars to browser-profile flag to automatically read from
  GRANTED_BROWSER_PROFILE environment variable
- Remove browser-profile from getConsoleURL condition to prevent env var
  from inadvertently triggering console URL generation
- Browser profile from env var is only used when actually launching
  browser (after all safety checks)

BREAKING CHANGE: The --browser-profile flag no longer triggers browser
opening by itself. Users must now explicitly use -c or -s flags along
with --browser-profile to open a browser. Previously, passing
--browser-profile alone would open a browser window, but now it only
sets which browser profile to use when a browser is opened via other
flags. This prevents the GRANTED_BROWSER_PROFILE environment variable
from inadvertently opening browsers.

This allows users to set a default browser profile via environment
variable that will be used whenever opening the console, while still
allowing --browser-profile flag to take precedence.

Fixes fwdcloudsec#886
… profile

Add support for GRANTED_SSO_BROWSER_PROFILE environment variable to override
the browser profile used when launching SSO login flows.

When using SSOBrowserLaunchTemplate, the environment variable will be used
to specify which browser profile to use for SSO authentication flows.

Usage:
export GRANTED_SSO_BROWSER_PROFILE="MySSOProfile"
assume <profile>  # SSO login will use "MySSOProfile" as the browser profile
…env var support

- Add --sso-browser-profile flag to assume, granted sso login, generate, and populate commands
- Add SSOBrowserProfile field to ConfigOpts to pass browser profile through SSO login flow
- Remove redundant environment variable check from idclogin.Login (handled by flag EnvVars)
- Add test case for empty browser profile in launcher tests
- Support GRANTED_SSO_BROWSER_PROFILE environment variable via flag EnvVars
@billyjbryant billyjbryant force-pushed the feat/browser-profile-env-var branch from ff6f3a1 to 40ca546 Compare January 15, 2026 19:41
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

Successfully merging this pull request may close these issues.

Set Default Chrome Browser Profile

1 participant