I’m trying to use the Management API to update the “Client Secret” on my Azure AD connections as part of a key rollover automation process, however it throws a 409 error as if I am trying to Create a new connection of the same name??? As the API documentation suggests, I submit the JSON request with the full set of Options since they will all be overwritten.
Invoke-RestMethod : {“statusCode”:409,“error”:“Conflict”,“message”:“A connection with the same name already exists”,“errorCode”:“connection_conflict”}
To update the client_secret on your Azure AD connection, you can use the [PATCH /api/v2/connections/{id}] (Auth0 Management API v2) enpoint and specify only the options(since the client_secret will be inside) and leaving out all the other attributes (like the name and strategy root attributes in your example).
The cURL command for this request would be something like:
curl -H "Authorization: Bearer {YOUR_MANAGMENT_API_TOKEN}" -X PATCH -H "Content-Type: application/json" -d '{"options":{"strategy":"waad","client_id":"{YOUR_AZURE_CLIENT_ID}","client_secret":"{YOUR_NEW_AZURE_CLIENT_SECRET}", {THE REMAINING OPTIONS FOR THE CONNECTION} }' "https://{YOUR_AUTH0_DOMAIN}/api/v2/connections/{YOUR_CONNECTION_ID}"
I see now that I should be able to just change the -Method to “PATCH” … I’ve done that but still working thru a 404 error now with that method in place