I am trying to create an SSO connection using a large meta xml provided by a client, but having issues

I am trying to create an SSO connection using a large meta xml provided by the client. To do this i am trying to use a curl script because there doesn’t seem to be a way to upload it into the UI. The issue is that the XML itself appears to be correctly formatted, however when using the curl script, it doesn’t like it at all. It just throws an error suggesting a parse error, but not really any information other than that. Is there a better way to do this?

Hi Brian.

The parse error could indicate that the XML is not formatted properly, even the smallest mistake int he file might trigger the error unfortunately.

My suggestion would be to use the public URL where their metadata is hosted. If they do not have one, you can try hosting it yourself using a public S3 bucket, a GitHub Gist, or any simple, public web host on which you can upload the XML file. Once you have done that, you will need to retrieve the public URL for it and use it in the cURL request as such:

METADATA_URL="https"//idp.client.com/saml/metadata.xml"

JSON_PAYLOAD=
{
  "name": "my-client-saml-connection",
  "strategy": "saml",
  "options": {
    "metadataUrl": "$METADATA_URL",
    "protocolBinding": "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"
  }
}

curl --request POST \
  --url "https"//$AUTH0_DOMAIN/api/v2/connections" \
  --header "Authorization: Bearer $MGMT_TOKEN" \
  --header "Content-Type: application/json" \
  --data "$JSON_PAYLOAD"

Let me know if the information above is useful or not regarding the matter or if you have any other questions!

Kind Regards,
Nik