Exception of type System.UriFormatException was thrown

Verify that you have the same URLEncryptionKey value in web.config for both Consumer and Provider applications. URLEncryptionKey is used for encrypting/decrypting data. Thus if you have set RestfulEnforceEncryption to True, then the key must match.