Skip to content

Commit

Permalink
fix(idp): set urls for idp update
Browse files Browse the repository at this point in the history
Refs: #1152
  • Loading branch information
Phil91 committed Nov 15, 2024
1 parent ab3c230 commit e34b3aa
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@ await provisioningManager.UpdateCentralIdentityProviderDataOIDCAsync(
alias,
iamIdentityProvider => iamIdentityProvider.MetadataUrl = metadataUrl,
iamIdentityProvider => iamIdentityProvider.MetadataUrl = details.Oidc.MetadataUrl);
await portalRepositories.SaveAsync().ConfigureAwait(ConfigureAwaitOptions.None);
}

private async ValueTask UpdateIdentityProviderSaml(string alias, IdentityProviderEditableDetails details)
Expand All @@ -323,6 +324,7 @@ await provisioningManager.UpdateCentralIdentityProviderDataSAMLAsync(
details.Saml.ServiceProviderEntityId,
details.Saml.SingleSignOnServiceUrl))
.ConfigureAwait(false);
await portalRepositories.SaveAsync().ConfigureAwait(ConfigureAwaitOptions.None);
}

private async ValueTask UpdateIdentityProviderShared(string alias, IdentityProviderEditableDetails details)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,31 +88,32 @@ private async ValueTask<IdentityProvider> SetIdentityProviderMetadataFromUrlAsyn
switch (key)
{
case "userInfoUrl":
changed.Config.UserInfoUrl = value as string;
changed.Config.UserInfoUrl = value.ToString();
break;
case "validateSignature":
changed.Config.ValidateSignature = value as string;
changed.Config.ValidateSignature = value.ToString();
break;
case "tokenUrl":
changed.Config.TokenUrl = value as string;
changed.Config.TokenUrl = value.ToString();
break;
case "authorizationUrl":
changed.Config.AuthorizationUrl = value as string;
changed.Config.AuthorizationUrl = value.ToString();
break;
case "jwksUrl":
changed.Config.JwksUrl = value as string;
changed.Config.JwksUrl = value.ToString();
break;
case "logoutUrl":
changed.Config.LogoutUrl = value as string;
changed.Config.LogoutUrl = value.ToString();
break;
case "issuer":
changed.Config.Issuer = value as string;
changed.Config.Issuer = value.ToString();
break;
case "useJwksUrl":
changed.Config.UseJwksUrl = value as string;
changed.Config.UseJwksUrl = value.ToString();
break;
}
}

return changed;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1688,6 +1688,7 @@ public async Task UpdateOwnCompanyIdentityProviderAsync_WithValidOidc_CallsExpec
modifiedIamIdentityProvider.Should().Match<IamIdentityProvider>(x =>
x.IamIdpAlias == "cl1" &&
x.MetadataUrl == "http://new");
A.CallTo(() => _portalRepositories.SaveAsync()).MustHaveHappenedOnceExactly();
}

[Fact]
Expand Down Expand Up @@ -1781,6 +1782,7 @@ public async Task UpdateOwnCompanyIdentityProviderAsync_WithValidSaml_CallsExpec
result.Mappers.Should().HaveCount(2);
result.DisplayName.Should().Be("dis-saml");
result.Enabled.Should().BeTrue();
A.CallTo(() => _portalRepositories.SaveAsync()).MustHaveHappenedOnceExactly();
}

[Fact]
Expand Down

0 comments on commit e34b3aa

Please sign in to comment.