cloudfoundry / cloudfoundry/uaa
Unable to update an existing active Saml identity provider and give it a new metadataurl when it's prior one was no longer valid
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.6k
- Forks
- 844
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 27
Description
What version of UAA are you running?
We're currently using 4.20 but found that the issue exists in the latest code base as well.
What did you do?
We're attempting to update an existing active identity provider whose metadataurl no longer points to a valid URL.
Ex:
- create a SAML identity provider with a valid metadataurl
- take the metadata provider offline (existing definition now has an invalid metadata url)
- use the UAA end point to update the identity provider and provide a new valid metadata url.
This fails b/c of SamlIdentityProviderConfiguration -> validateSamlIdentityProviderDefinition
When it's validating the new properties of the definitions, it actually tries to go and get existing IdentityProviders for that identity zone and calls getExtendedMetadataDelegate on every existing provider (including the existing one that we already know doesn't have a valid metadataurl). downstream that throws an exception unable to fetch metadata and we're not able to update the provider.
for (SamlIdentityProviderDefinition existing : getIdentityProviderDefinitions()) {
ConfigMetadataProvider existingProvider = (ConfigMetadataProvider) getExtendedMetadataDelegate(existing).getDelegate();
if (entityIDToBeAdded.equals(existingProvider.getEntityID()) &&
!(existing.getUniqueAlias().equals(clone.getUniqueAlias()))) {
entityIDexists = true;
break;
}
}
What did you expect to see? What goal are you trying to achieve with the UAA?
I should be able to update an existing IdentityProvider and give it a new valid metadataurl after the current one is no longer valid.
What did you see instead?
It threw an exception unable to fetch metadata
Please include UAA logs if available.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in SamlIdentityProviderConfiguration.validateSamlIdentityProviderDefinition and trace the identity-provider update endpoint through getIdentityProviderDefinitions and getExtendedMetadataDelegate. Reproduce the case with an existing provider whose metadataurl is invalid, then verify that supplying a new valid metadataurl updates it without failing while checking the other providers for duplicate entity IDs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- authentication
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100