OTA-Insight / djangosaml2idp

SAML 2.0 Identity Provider in Django
Apache License 2.0
104 stars 97 forks source link

Is there a way to capture 'SAMLResponse' without redirect to ACS URL #138

Closed deokgonkim closed 1 year ago

deokgonkim commented 2 years ago

Is there a way to capture 'SAMLResponse' without redirect to ACS URL.

I'm using djangosaml2idp as Identity Provider for AWS IAM Federation SSO Login.

And I want to use AWS STS assume-role-with-saml to provide programatical way to access AWS using AWS API or AWS CLI.

For example, if I initiate SAML with my custom configuration as follows.

    saml_client = _get_saml_client()
    _, info = saml_client.prepare_for_authenticate()

    redirect_url = None

    for key, value in info['headers']:
        if key == 'Location':
            redirect_url = value
            break

    return HttpResponseRedirect(redirect_url)

Can I pass custom acs_url (not the AWS ACS_URL) to get SAMLResponse value?