(request, idp_slug)
return resp
Returns XML with SAML 2.0 Metadata as the Service Provider (SP).
    Often referred to as the SP Identifier or SP Entity ID in the
    Identity Provider's Documentation.
Returns XML with SAML 2.0 Metadata as the Service Provider (SP).
    Often referred to as the SP Identifier or SP Entity ID in the
    Identity Provider's Documentation.
Returns XML with SAML 2 . 0 Metadata as the Service Provider ( SP ) . Often referred to as the SP Identifier or SP Entity ID in the Identity Provider s Documentation .
def sso_saml_metadata(request, idp_slug):
    """
    Returns XML with SAML 2.0 Metadata as the Service Provider (SP).
    Often referred to as the SP Identifier or SP Entity ID in the
    Identity Provider's Documentation.
    """
    saml_settings = OneLogin_Saml2_Settings(get_saml2_config(request.idp))
    metadata = saml_settings.get_sp_metadata()
    errors = saml_settings.validate_metadata(metadata)

    if len(errors) == 0:
        resp = HttpResponse(content=metadata, content_type='text/xml')
    else:
        resp = HttpResponseServerError(content=', '.join(errors))
    return resp
def sso_saml_metadata ( request , idp_slug ) : saml_settings = OneLogin_Saml2_Settings ( get_saml2_config ( request . idp ) ) metadata = saml_settings . get_sp_metadata ( ) errors = saml_settings . validate_metadata ( metadata ) if len ( errors ) == 0 : resp = HttpResponse ( content = metadata , content_type = 'text/xml' ) else : resp = HttpResponseServerError ( content = ', ' . join ( errors ) ) return resp