title: AWS Java SDK not finding profile when using AWS SSO
body: <p>I can't reach aws when my login is made using AWS SSO.
  I login from my computer using:</p>
  <pre><code>aws sso login --profile staging
  </code></pre>
  <p>The profile is configured like this:</p>
  <pre><code>[profile staging]
  sso_start_url = https://som-nice-working-url
  sso_region = us-east-1
  sso_account_id = 1234
  sso_role_name = the-role-name
  region = eu-west-1
  output = yaml
  </code></pre>
  <p>After doing the login I can access aws through aws cli.</p>
  <p>Then I set the varible: <code>AWS_PROFILE=staging</code>
  But on java I'm getting the following exception:</p>
  <pre><code>com.amazonaws.SdkClientException: Unable to load AWS credentials from any provider in the chain: [EnvironmentVariableCredentialsProvider: Unable to load AWS credentials from environment variables (AWS_ACCESS_KEY_ID (or AWS_ACCESS_KEY) and AWS_SECRET_KEY (or AWS_SECRET_ACCESS_KEY)), SystemPropertiesCredentialsProvider: Unable to load AWS credentials from Java system properties (aws.accessKeyId and aws.secretKey), WebIdentityTokenCredentialsProvider: You must specify a value for roleArn and roleSessionName, com.amazonaws.auth.profile.ProfileCredentialsProvider@369a95a5: No AWS profile named 'staging', com.amazonaws.auth.EC2ContainerCredentialsProviderWrapper@6d6f6ca9: Failed to connect to service endpoint: ]
  </code></pre>
  <p>I have tryed using the ProfileCredentialsProvider with &quot;staging&quot; but the result is the same.</p>
  <p>What <code>CredentialsProvider</code> should I use?</p>
  <p>My code is using the DefaultProviderChain:</p>
  <pre><code>AWSGlueClient.builder()
              .withRegion(&quot;eu-west-1&quot;)
              .build()
  </code></pre>
  <p>Thank you.</p>