Skip to content

Commit a94c660

Browse files
committed
sonar says not in use
1 parent 2d6b885 commit a94c660

File tree

4 files changed

+4
-6
lines changed

4 files changed

+4
-6
lines changed

server/src/main/java/org/cloudfoundry/identity/uaa/invitations/InvitationsController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public String acceptInvitePage(@RequestParam String code, Model model, HttpServl
144144

145145
SamlIdentityProviderDefinition definition = ObjectUtils.castInstance(provider.getConfig(), SamlIdentityProviderDefinition.class);
146146

147-
String redirect = "redirect:/" + SamlRedirectUtils.getIdpRedirectUrl(definition, spEntityID, IdentityZoneHolder.get());
147+
String redirect = "redirect:/" + SamlRedirectUtils.getIdpRedirectUrl(definition);
148148
logger.debug(String.format("Redirecting invitation for email:%s, id:%s single SAML IDP URL:%s", codeData.get("email"), codeData.get("user_id"), redirect));
149149
return redirect;
150150
} else if (OIDC10.equals(provider.getType()) || OAUTH20.equals(provider.getType())) {

server/src/main/java/org/cloudfoundry/identity/uaa/login/LoginInfoEndpoint.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ public String deleteSavedAccount(HttpServletRequest request, HttpServletResponse
597597
private String redirectToExternalProvider(AbstractIdentityProviderDefinition idpForRedirect, String idpOriginKey, HttpServletRequest request) {
598598
if (idpForRedirect != null) {
599599
if (idpForRedirect instanceof SamlIdentityProviderDefinition samlIdentityProviderDefinition) {
600-
String url = SamlRedirectUtils.getIdpRedirectUrl(samlIdentityProviderDefinition, entityID, IdentityZoneHolder.get());
600+
String url = SamlRedirectUtils.getIdpRedirectUrl(samlIdentityProviderDefinition);
601601
return "redirect:/" + url;
602602
} else if (idpForRedirect instanceof AbstractExternalOAuthIdentityProviderDefinition providerDefinition) {
603603
String redirectUrl = getRedirectUrlForExternalOAuthIDP(request, idpOriginKey, providerDefinition);

server/src/main/java/org/cloudfoundry/identity/uaa/provider/saml/SamlRedirectUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ private SamlRedirectUtils() {
2525
throw new java.lang.UnsupportedOperationException("This is a utility class and cannot be instantiated");
2626
}
2727

28-
public static String getIdpRedirectUrl(SamlIdentityProviderDefinition definition, String entityId, IdentityZone identityZone) {
28+
public static String getIdpRedirectUrl(SamlIdentityProviderDefinition definition) {
2929
String entityIdAlias = definition.getIdpEntityAlias();
3030
UriComponentsBuilder builder = UriComponentsBuilder.fromPath("saml2/authenticate/%s".formatted(entityIdAlias));
3131
return builder.build().toUriString();

server/src/test/java/org/cloudfoundry/identity/uaa/provider/saml/SamlRedirectUtilsTest.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
import org.cloudfoundry.identity.uaa.provider.SamlIdentityProviderDefinition;
1818
import org.cloudfoundry.identity.uaa.zone.IdentityZone;
19-
import org.cloudfoundry.identity.uaa.zone.IdentityZoneHolder;
2019
import org.junit.jupiter.api.Test;
2120

2221
import static org.assertj.core.api.Assertions.assertThat;
@@ -36,8 +35,7 @@ void getIdpRedirectUrl() {
3635
.setLinkText("link text")
3736
.setZoneId(IdentityZone.getUaaZoneId());
3837

39-
String domain = "login.random-made-up-url.com";
40-
String url = SamlRedirectUtils.getIdpRedirectUrl(definition, domain, IdentityZoneHolder.get());
38+
String url = SamlRedirectUtils.getIdpRedirectUrl(definition);
4139
assertThat(url).isEqualTo("saml2/authenticate/simplesamlphp-url");
4240
}
4341

0 commit comments

Comments
 (0)