granted icon indicating copy to clipboard operation
granted copied to clipboard

CustomSSOBrowserPath not working for Safari

Open shwethaumashanker opened this issue 1 year ago • 1 comments

The problem is caused because we need to shell out to open -a Safari <url> to launch Safari the custom SSO setting instead is calling /Applications/Safari.app/Contents/MacOS/Safari <url> which is causing the local file window to appear.

Current workaround:

  1. Create a file called launch-safari.sh in ~/.granted (doesn’t really matter where you put it)
  2. The file should contain
#!/bin/bash

open -a Safari $1
  1. Run chmod +x launch-safari.sh to make the file executable
  2. Set the CustomSSOBrowserPath = "/Users/Username/.granted/launch-safari.sh" (Or the path of where you placed the file)

Long term we want to shift towards a templated command approach, e.g. CustomSSOCommandTemplate = "open -a Safari {{ .URL }}"

Place to get started in the code base: https://github.com/common-fate/granted/blob/4f24b96a8de140ea3748568c779081cace61ba04/pkg/cfaws/assumer_aws_sso.go#L290-L295

shwethaumashanker avatar Feb 01 '24 23:02 shwethaumashanker