3.8.5.1.2.3 Processing Details
If the publishing settings specified in Relying Party Trust Publishing Settings have not been set previously the server MUST return a HTTP error code of 404.
If they have been set then use the following algorithm for processing this request:
If the [Relying Party Trust Publishing Settings].proxyTrustedEndpointUrl is missing or the [Relying Party Trust Publishing Settings].internalUrl is present in the request body, the server MUST return an HTTP error code of 400.
If the Relying Party Trust (section 2.2.2.6) with objectIdentifier with the same string value as {Identifier} in [Server State].RelyingPartyTrusts is not found, or if [Server State].RelyingPartyTrusts[objectIdentifier:={Identifier}].proxyTrustedEndpoints with the value of [Relying Party Trust Publishing Settings].proxyTrustedEndpointUrl is not found, or if [Relying Party Trust Publishing Settings].externalUrl is specified and an entry with the matching externalUrl is not found in [Server State].RelyingPartyTrusts[objectIdentifier:={Identifier}].proxyEndpointMappings, the server MUST return an HTTP error code of 404.
On the Relying Party Trust (section 2.2.2.6) [Server State].RelyingPartyTrusts[objectIdentifier:={Identifier}], remove the entry from Relying Party Trust Publishing Settings (section 2.2.2.7) that contains in proxyTrustedEndpointUrl the value of [Relying Party Trust Publishing Settings].proxyTrustedEndpointUrl from the request body.
If the value of [Relying Party Trust Publishing Settings].externalUrl is present in the request body, remove the entry from [Server State].RelyingPartyTrusts[objectIdentifier:={Identifier}].proxyEndpointMappings that has an enternalUrl matching of [Relying Party Trust Publishing Settings].externalUrl from the request body.