aws-toolkit-jetbrains icon indicating copy to clipboard operation
aws-toolkit-jetbrains copied to clipboard

SSO token provider configuration not supported

Open adonskoy opened this issue 3 years ago • 9 comments

Describe the bug AWS IAM Identity Center (successor to AWS Single Sign-On) introduces a new kind of configuration, sso-session, which can be referenced by a profile. The toolkit does not load profile when sso_session is used.

To reproduce

  1. Configure the new profile via aws configure sso
  2. Open IDE
  3. Get an informational message that the profile was not loaded with following detail error: java.lang.IllegalArgumentException: Profile 'test-profile' is not using role-based, session-based, process-based, or basic credentials.

Expected behavior The toolkit recognizes this type of profile and allows you to use it.

Your Environment

  • OS: macOS 13.0.1
  • JetBrains product: WebStorm
  • JetBrains product version: 2022.3
  • AWS Toolkit version: 1.56-223
  • SAM CLI version:
  • JVM/Python version:

adonskoy avatar Dec 12 '22 21:12 adonskoy

I am seeing the same issue using the AwsToolkit in IntelliJ:

the config file that I am using looks like this:

[profile silver]
sso_session = my-sso
sso_account_id = 555614872555
sso_role_name = silver-developer
region = us-west-2
output = json

[sso-session my-sso]
sso_start_url = https://my-login-source.awsapps.com/start/
sso_region = us-west-2

MattWiersma avatar Dec 14 '22 18:12 MattWiersma

I am having the same issue, it doesn't support sso_session.

dylanenabled avatar Dec 21 '22 00:12 dylanenabled

Had a quick look at the code and it's currently checking the profile for the sso_start_url property, but doesn't have a branch for profiles using the sso_session property.

A work around that works for me is to create an additional profile and copy the sso-session fields e.g.:

[profile silver]
sso_session = my-sso
sso_account_id = 555614872555
sso_role_name = silver-developer
region = us-west-2
output = json

[sso-session my-sso]
sso_start_url = https://my-login-source.awsapps.com/start/
sso_region = us-west-2

[profile silver-ide]
sso_start_url = https://my-login-source.awsapps.com/start/
sso_region = us-west-2
sso_account_id = 555614872555
sso_role_name = silver-developer
region = us-west-2
output = json

petercoulton avatar Jan 05 '23 11:01 petercoulton

We recently ran into this as well, looks like the workaround is to hit enter on the SSO session name (Recommended): prompt, and the CLI will use the old Legacy format.

edeesis avatar Jan 24 '23 21:01 edeesis

We will advising users in the SDK guides to use a default profile as shown in the following sample. But I'm currently getting the same error as the others, but with this error message, java.lang.IllegalArgumentException: Profile 'default' is not using role-based, session-based, process-based, or basic credentials.

[default]
sso_session = my-sso
sso_account_id = 1234567890
sso_role_name = AdministratorAccess
region = us-east-1
output = json

[sso-session my-sso]
sso_start_url = https://blahblah.awsapps.com/start
sso_region = us-east-1
sso_registration_scopes = sso:account:access

tkhill-AWS avatar Feb 01 '23 15:02 tkhill-AWS

Same issue with PyCharm

leonchik1976 avatar Feb 03 '23 13:02 leonchik1976

As a workaround it is sufficient to copy the sso_start_url and sso_region properties from the [sso-session] block into the [profile] block

[profile my-sso]
sso_session = my-sso
sso_account_id = 1234567890
sso_role_name = AWSAdministratorAccess
region = eu-central-1
output = json
sso_start_url = https://dings-bums.awsapps.com/start
sso_region = eu-central-1

[sso-session my-sso]
sso_start_url = https://dings-bums.awsapps.com/start
sso_region = eu-central-1
sso_registration_scopes = sso:account:access

frankwese avatar Feb 08 '23 17:02 frankwese

I ran into this issue today. I was able to work around it following the work around above from @frankwese

JKomoroski avatar Feb 10 '23 21:02 JKomoroski

@rli, it's been about a year since aws introduced sso sessions. Any estimate on when this will be supported in the toolkit?

adonskoy avatar Oct 20 '23 06:10 adonskoy