Describe the bug When attempting to add a new collection in my InMemoryRelyingPartyRegistrationRepository, it does not work. I placed a breakpoint in the createMappingToIdentityProvider method, and it indeed returns all the metadata. However, when debugging the resolve method in DefaultRelyingPartyRegistrationResolver, my relyingPartyRegistrationRepository only contains the relying party it had when loaded as a @Bean.

To Reproduce

Create a @Bean with initial RelyingParties, and then try to add a new collection, like this:

    public void addNewMetadata(RelyingPartyRegistration relyingPartyRegistration) {
        registrations.add(relyingPartyRegistration);
        new InMemoryRelyingPartyRegistrationRepository(registrations);
    }

Expected behavior It should override the old collection.

Sample This code work:

  @Bean
    public RelyingPartyRegistrationRepository relyingPartyRegistrationRepository() {

        // ... (existing code)

        return new InMemoryRelyingPartyRegistrationRepository(registrations);
    }

The registrations remain the same as those logged within the bean, even with the following method:

   public void addNewMetadata(RelyingPartyRegistration relyingPartyRegistration) {
        registrations.add(relyingPartyRegistration);
        new InMemoryRelyingPartyRegistrationRepository(registrations);
    }

Reports that include a sample will take priority over reports that do not. At times, we may require a sample, so it is good to try and include a sample up front.