title: Unable to get temporary credentials for Amazon Dynamodb access using Google Login in Android
body: <p>I received the token from Google but not able to get the required aws credentials using WebIdentityFederationSessionCredentialsProvider in Android.(Getting error:Unable to load AWS Credentials from any provider in the chain).Need help.</p>
  
  <p>Code Used is given below</p>
  
  <pre><code>    public void login( WIFIdentityProvider wifIDP, final AlertActivity activity ) {
      idp = wifIDP;
      AWSSecurityTokenServiceClient sts=new AWSSecurityTokenServiceClient();
      sts.setRegion(Region.getRegion(Regions.US_WEST_2));             
      wif = new WebIdentityFederationSessionCredentialsProvider(idp.getToken(),idp.getProviderID(),idp.getRoleARN(),sts); 
      //call refresh to login from an AsyncTask because refreshing requires the network
  
      new AsyncTask&lt;Void, Void, Throwable&gt;() {
          @Override
          protected Throwable doInBackground(Void... arg0) {
  
              try {
                  wif.refresh();////ERROR RECEIVED AT THIS POINT
              } catch (Throwable t) {
                  Log.d("buzz","Err:"+t);
                  return t;
              }
              return null;
          }
  
          @Override
          protected void onPostExecute(Throwable t) {
              if (t != null) {
                  Log.e(LOG_TAG, "Unable to login.", t);
                  activity.setResult(Activity.RESULT_CANCELED);
  
              } else {
                  ddb = new AmazonDynamoDBClient( wif );
                  ddb.setRegion(Region.getRegion(Regions.US_WEST_2));
                  AmazonSharedPreferencesWrapper.storeUsername(sharedPreferences, wif.getSubjectFromWIF());
                  Log.d(LOG_TAG, "Logged in with user id " + wif.getSubjectFromWIF());
                  activity.setResult(Activity.RESULT_OK);
              }
              activity.finish();
          }
      }.execute();
  }
  </code></pre>