SAML login for AWS using Shibboleth IDP
The implementation relies on HTML parsing of the Shibboleth redirect page (HTML form) and the AWS role selection page.
This package requires Python 3.4.
$ sudo pip3 install --upgrade aws-saml-login
from aws_saml_login import authenticate, assume_role, write_aws_credentials # authenticate against identity provider saml_xml, roles = authenticate('https://shibboleth-idp.example.org', user, password) print(roles) # just use the first role here, we might display a user dialog to choose one first_role = roles provider_arn, role_arn, account_name = first_role # get temporary AWS credentials key_id, secret, session_token = assume_role(saml_xml, provider_arn, role_arn) # write to ~/.aws/credentials write_aws_credentials('default', key_id, secret, session_token) # AWS SDK (e.g. boto) can be used to call AWS endpoints
Copyright © 2015 Zalando SE
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Release history Release notifications | RSS feed
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size aws-saml-login-0.4.tar.gz (6.5 kB)||File type Source||Python version None||Upload date||Hashes View|