title: Boto3: Unable to list contents of AWS S3 through python
body: <p>I am trying to connect to AWS S3 and list the buckets from my local machine through python. I am using the following code</p>
  <pre><code>import boto3
  from boto3 import Session
  from boto.s3.connection import S3Connection
  from boto.sts import STSConnection
  import pandas
  
  session = boto3.Session(profile_name='mfa_0729')
  credentials=session.get_credentials()
  dev_s3_client = session.client('s3')
  dev_s3_resource = session.resource('s3')
  bucketname = 'my-bucket-name'
  startAfter = 'my-claim-name'
  obj1=dev_s3_client.list_objects_v2(Bucket=bucketname, StartAfter=startAfter )
  </code></pre>
  <p>There is a session token that I have to use that I saved in the profile along with other credentials. When executing the last line, I get the error</p>
  <blockquote>
  <p>botocore.exceptions.ClientError: An error occurred (AccessDenied) when calling the ListObjectsV2 operation: Access Denied</p>
  </blockquote>
  <p>Can anyone point out what am I doing wrong? I am new to AWS and boto3.</p>