Auth0 Home Blog Docs

How to create a new SAML connection using the management API?

api
management-api
samlp

#1

I want to create a new SAMLP connection using the management API. This aspect is poorly documented. It is unclear how to attach the signingCertificate to the connection using rest API. This is what I try to post:

{ "name": "test", "strategy": "samlp", "options": { "domain_aliases": ], "signInEndpoint": "https://someurl", "signingCert": "base64_cert", }, "enabled_clients":  "xxx" ] }

I get the following error:

{"statusCode":400,"error":"Bad Request","message":"The signing certificate is not valid. Please provide a .pem or .cer certificate base64 encoded public key","errorCode":"invalid_body"} 

In general the whole aspect of creating a connection using the API is poorly documented. Please improve it and provide samples for all the different strategies


#2

Thanks for the feedback, I can confirm that the lack of detailed documentation for individual properties in each type of connection options is something that is already being tracked so that it can be addressed.

In relation to the error in question, the signingCert needs to be provided in a base64 encoding, more specifically, if you have a *.pem encoded certificate file you can open it to find something like:

-----BEGIN CERTIFICATE-----
MIIEFzCCAv+gAwIBAgIUbfFTTfdi07R+JkMxKrL5XJpqnw4wDQYJKoZIhvcNAQEF
BQAwWDELMAkGA1UEBhMCVVMxEDAOBgNVBAoMB1dpZGdpdHMxFTATBgNVBAsMDE9u
-----END CERTIFICATE-----

You would then encode the above data (including the BEGIN/END markers in Base64 and use that as the value for the signingCert property.


#3

Can you, by any chance, post all the supported properties for samlp here?


#4