diff --git a/awsprocesscreds/saml.py b/awsprocesscreds/saml.py index d1c6a0a..bd6b81c 100644 --- a/awsprocesscreds/saml.py +++ b/awsprocesscreds/saml.py @@ -153,7 +153,7 @@ def _retrieve_login_form_from_endpoint(self, endpoint): login_form_html_node = self._parse_form_from_html(response.text) if login_form_html_node is None: raise SAMLError(self._ERROR_NO_FORM % endpoint) - form_action = urljoin(response.url, + form_action = urljoin(endpoint, login_form_html_node.attrib.get('action', '')) if not form_action.lower().startswith('https://'): raise SAMLError('Your SAML IdP must use HTTPS connection')