diff --git a/server/src/main/java/org/cloudfoundry/identity/uaa/authentication/UaaSamlPrincipal.java b/server/src/main/java/org/cloudfoundry/identity/uaa/authentication/UaaSamlPrincipal.java index 9c8c002347..a83cb43d78 100644 --- a/server/src/main/java/org/cloudfoundry/identity/uaa/authentication/UaaSamlPrincipal.java +++ b/server/src/main/java/org/cloudfoundry/identity/uaa/authentication/UaaSamlPrincipal.java @@ -32,7 +32,7 @@ * The SAML Logout Handlers check if the Principal is an instance of Saml2AuthenticatedPrincipal to handle SAML Logout. */ @ToString(callSuper = true) -@JsonIgnoreProperties({"relyingPartyRegistrationId", "attributes"}) +@JsonIgnoreProperties({"relyingPartyRegistrationId", "sessionIndexes", "attributes"}) public class UaaSamlPrincipal extends UaaPrincipal implements Saml2AuthenticatedPrincipal, Serializable { @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/server/src/main/java/org/cloudfoundry/identity/uaa/provider/saml/SamlUaaResponseAuthenticationConverter.java b/server/src/main/java/org/cloudfoundry/identity/uaa/provider/saml/SamlUaaResponseAuthenticationConverter.java index 024c0ca63c..51d70b3d33 100644 --- a/server/src/main/java/org/cloudfoundry/identity/uaa/provider/saml/SamlUaaResponseAuthenticationConverter.java +++ b/server/src/main/java/org/cloudfoundry/identity/uaa/provider/saml/SamlUaaResponseAuthenticationConverter.java @@ -80,7 +80,6 @@ public UaaAuthentication convert(OpenSaml4AuthenticationProvider.ResponseToken r Response response = responseToken.getResponse(); List assertions = response.getAssertions(); String subjectName = assertions.get(0).getSubject().getNameID().getValue(); - List sessionIndexes; IdentityZone zone = identityZoneManager.getCurrentIdentityZone(); log.debug("Initiating SAML authentication in zone '{}' domain '{}'", @@ -116,7 +115,7 @@ public UaaAuthentication convert(OpenSaml4AuthenticationProvider.ResponseToken r UaaUser user = userManager.createIfMissing(initialPrincipal, addNew, getMappedAuthorities( idp, samlAuthorities), userAttributes); - sessionIndexes = assertions.stream().flatMap(assertion -> assertion.getAuthnStatements().stream().filter(Objects::nonNull).map(s -> s.getSessionIndex()).filter(Objects::nonNull)).toList(); + List sessionIndexes = assertions.stream().flatMap(assertion -> assertion.getAuthnStatements().stream().filter(Objects::nonNull).map(s -> s.getSessionIndex()).filter(Objects::nonNull)).toList(); UaaAuthentication authentication = new UaaAuthentication( new UaaSamlPrincipal(user, sessionIndexes), authenticationToken.getCredentials(),