common-fate / granted

The easiest way to access your cloud.
https://granted.dev
MIT License
956 stars 90 forks source link

CustomSSOBrowserPath not working for Safari #602

Open shwethaumashanker opened 5 months ago

shwethaumashanker commented 5 months ago

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)
    1. The file should contain
      
      #!/bin/bash

open -a Safari $1


3. Run `chmod +x launch-safari.sh` to make the file executable
4. 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