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

Open
#2,018 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

in_review unscheduled
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:

  1. create a SAML identity provider with a valid metadataurl
  2. take the metadata provider offline (existing definition now has an invalid metadata url)
  3. 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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.