# ec2.py auth error when using Boto3 Profiles with SAML Auth and Assumed Role

**URL:** <https://forum.ansible.com/t/ec2-py-auth-error-when-using-boto3-profiles-with-saml-auth-and-assumed-role/24392>\
**Category:** Ansible Project\
**Tags:** aws\
**Created:** [May 3, 2017, 6:46pm UTC](https://forum.ansible.com/t/ec2-py-auth-error-when-using-boto3-profiles-with-saml-auth-and-assumed-role/24392 "2017-05-03T18:46:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tony\_Vinson](https://avatars.discourse-cdn.com/v4/letter/t/65b543/32.png) [@Tony\_Vinson](https://forum.ansible.com/u/Tony_Vinson)\
**Post date:** [May 3, 2017, 6:46pm UTC](https://forum.ansible.com/t/ec2-py-auth-error-when-using-boto3-profiles-with-saml-auth-and-assumed-role/24392/1 "2017-05-03T18:46:30Z")

</div>

Hi,

Just trying to see if anyone else has run into this error, these boto profiles work fine for AWS-cli but I get the following error when trying to use ec2.py

python3 ec2.py --profile product-XXXX-XX

_Boto configs found at ‘~/.aws/credentials’, but the credentials contained may not be correct", while: getting EC2 instances._

~/.aws/credentials (Scrubbed)

[default]  
output = json  
region = us-east-1  
aws\_access\_key\_id =  
aws\_secret\_access\_key =

[product-xxxx-xx]  
output = json  
region = us-east-1  
aws\_access\_key\_id = ASIAJLBHA3FUXXXXXXXX  
aws\_secret\_access\_key = /O26NnkyNaQqQ9GxhemAXXXXXXXXXXX  
aws\_session\_token = BLAH==  
saml\_role\_arn = arn:aws:iam::XXXXXXXXX:role/ADFS-Readonly  
saml\_principal\_arn = arn:aws:iam::XXXXXXXXX:saml-provider/ADFS

[product-xxx-xx]  
output = json  
region = us-east-1  
aws\_access\_key\_id = ASIAIAOWQAOIS4I7LSAQ  
aws\_secret\_access\_key = buqQQsdHyZrWAYQsn95BTGiXXXXXXXXX  
aws\_session\_token = BLAH==  
saml\_role\_arn = arn:aws:iam::XXXX:role/ADFS-Admin  
saml\_principal\_arn = arn:aws:iam::XXXXX:saml-provider/ADFS

Thanks in advance,

Tony
