Skip to content

Commit

Permalink
fix integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
strehle committed Nov 12, 2024
1 parent 8f99520 commit 2ca7bae
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ public UaaAuthentication convert(OpenSaml4AuthenticationProvider.ResponseToken r
Response response = responseToken.getResponse();
List<Assertion> assertions = response.getAssertions();
String subjectName = assertions.get(0).getSubject().getNameID().getValue();
List<String> sessionIndexes;

IdentityZone zone = identityZoneManager.getCurrentIdentityZone();
log.debug("Initiating SAML authentication in zone '{}' domain '{}'",
Expand Down Expand Up @@ -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<String> 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(),
Expand Down

0 comments on commit 2ca7bae

Please sign in to comment.