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

Cannot open a browser session for profile with sso #54

Closed
bakousylla opened this issue Feb 24, 2022 · 6 comments · Fixed by #55
Closed

Cannot open a browser session for profile with sso #54

bakousylla opened this issue Feb 24, 2022 · 6 comments · Fixed by #55

Comments

@bakousylla
Copy link

Hi,

Thanks for this initiative, nice work.

I've tried to open the browser (chrome) and I've this issue on below.

Could you please help me about that ?

cat ~/.aws/config

[profile admin-dev]
sso_start_url = https://test.awsapps.com/start
sso_region = eu-west-1
sso_account_id = 1234567890
sso_role_name = AdministratorAccess
region = eu-west-1

assume -c

? Please select the profile you would like to assume: admin-dev
If browser is not opened automatically, please open link:
https://device.sso.eu-west-1.amazonaws.com/?user_code=NNJW-TVSX

Awaiting authentication in the browser...
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x1024de644]

goroutine 1 [running]:
github.com/99designs/keyring.(*fileKeyring).unlock(0x140003c93b0)
/Users/runner/go/pkg/mod/github.com/99designs/keyring@v1.2.0/file.go:70 +0xa4
github.com/99designs/keyring.(*fileKeyring).Set(0x140003c93b0, {{0x1400017acc0, 0x20}, {0x14000547b80, 0x527, 0x580}, {0x0, 0x0}, {0x0, 0x0}, ...})
/Users/runner/go/pkg/mod/github.com/99designs/keyring@v1.2.0/file.go:139 +0x98
github.com/common-fate/granted/pkg/credstore.Store({0x1400017acc0, 0x20}, {0x1027fd200, 0x140003c91a0})
/Users/runner/work/granted-cli-build/granted-cli-build/granted/pkg/credstore/credstore.go:35 +0xdc
github.com/common-fate/granted/pkg/cfaws.StoreSSOToken({0x1400017acc0, 0x20}, {{0x140001a8000, 0x4e9}, {0xc07e2169a6aefc10, 0x1a3373598536, 0x102ca3240}})
/Users/runner/work/granted-cli-build/granted-cli-build/granted/pkg/cfaws/secure_token_storage.go:32 +0x64
github.com/common-fate/granted/pkg/cfaws.(*CFSharedConfig).SSOLogin(0x14000264780, {0x102894c70, 0x14000144008})
/Users/runner/work/granted-cli-build/granted-cli-build/granted/pkg/cfaws/sso.go:61 +0x1ac
github.com/common-fate/granted/pkg/cfaws.(*CFSharedConfig).Assume(0x14000264780, {0x102894c70, 0x14000144008})
/Users/runner/work/granted-cli-build/granted-cli-build/granted/pkg/cfaws/profiles.go:190 +0x1d8
github.com/common-fate/granted/pkg/assume.AssumeCommand(0x14000143ac0)
/Users/runner/work/granted-cli-build/granted-cli-build/granted/pkg/assume/assume.go:88 +0x610
github.com/common-fate/granted/pkg/updates.WithUpdateCheck.func1(0x14000143ac0)
/Users/runner/work/granted-cli-build/granted-cli-build/granted/pkg/updates/updates.go:69 +0xc8
github.com/urfave/cli/v2.(*App).RunContext(0x14000242820, {0x102894c70, 0x14000144008}, {0x14000148000, 0x2, 0x2})
/Users/runner/go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/app.go:322 +0x6e8
github.com/urfave/cli/v2.(*App).Run(...)
/Users/runner/go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/app.go:224
main.main()
/Users/runner/work/granted-cli-build/granted-cli-build/granted/cmd/assume/main.go:13 +0x60

@chrnorm
Copy link
Contributor

chrnorm commented Feb 24, 2022

Thanks for the issue @bakousylla! What operating system and version of Granted are you running?

To find the version of Granted you can run granted -v.

@bakousylla
Copy link
Author

bakousylla commented Feb 24, 2022

@chrnorm
granted -v
Version: 0.1.3

macOS 11.6 (20G165)
Darwin 20.6.0 Darwin Kernel Version 20.6.0: Mon Aug 30 06:12:20 PDT 2021; root:xnu-7195.141.6~3/RELEASE_ARM64_T8101 arm64

@hilman-k8n
Copy link

facing the same issue with sso on v0.1.3
macos 11.6
20.6.0 Darwin Kernel Version 20.6.0: Mon Aug 30 06:12:21 PDT 2021; root:xnu-7195.141.6~3/RELEASE_X86_64 x86_64

@chrnorm
Copy link
Contributor

chrnorm commented Feb 25, 2022

Hi @hilman-k8n and @bakousylla, we believe that the issue has been fixed in #55. This has been released as part of v0.1.5. Could you please update your version of Granted (on MacOS with brew you can simply run brew install granted to grab the new version) and let us know if this has fixed the issue for you?

@bakousylla
Copy link
Author

Hi @chrnorm, My issue has been fixed. Thanks for your time and this initiative again.

@JoshuaWilkes
Copy link
Contributor

Hi @hilman-k8n and @bakousylla ,

Just following up on this issue. In order to have the correct experience with the secure credentials cache you may need to run rm ~/.granted/cred-store followed by assume <profile name>

You should be prompted for a password for your secure cache.
Running assume <profile name> a second time you should not be prompted to authorise in the browser and session credentials should be fetched immediately using the cached token.

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 a pull request may close this issue.

4 participants