Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(idp): set urls for idp update #1153

Merged
merged 1 commit into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading